00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00043 #ifndef __vtkSQLiteQuery_h
00044 #define __vtkSQLiteQuery_h
00045
00046 #include "vtkSQLQuery.h"
00047
00048 class vtkSQLiteDatabase;
00049 class vtkVariant;
00050 class vtkVariantArray;
00051 struct vtk_sqlite3_stmt;
00052
00053 class VTK_IO_EXPORT vtkSQLiteQuery : public vtkSQLQuery
00054 {
00055
00056 friend class vtkSQLiteDatabase;
00057
00058
00059 public:
00060 vtkTypeMacro(vtkSQLiteQuery, vtkSQLQuery);
00061 void PrintSelf(ostream& os, vtkIndent indent);
00062 static vtkSQLiteQuery *New();
00063
00066 bool SetQuery(const char *query);
00067
00070 bool Execute();
00071
00073 int GetNumberOfFields();
00074
00076 const char* GetFieldName(int i);
00077
00080 int GetFieldType(int i);
00081
00083 bool NextRow();
00084
00086 bool HasError();
00087
00089
00090 bool BeginTransaction();
00091 bool RollbackTransaction();
00092 bool CommitTransaction();
00094
00096 vtkVariant DataValue(vtkIdType c);
00097
00099 const char* GetLastErrorText();
00100
00102
00107 using vtkSQLQuery::BindParameter;
00108 bool BindParameter(int index, unsigned char value);
00109 bool BindParameter(int index, signed char value);
00110 bool BindParameter(int index, unsigned short value);
00111 bool BindParameter(int index, short value);
00112 bool BindParameter(int index, unsigned int value);
00113
00114 bool BindParameter(int index, int value);
00115
00116 bool BindParameter(int index, unsigned long value);
00117 bool BindParameter(int index, long value);
00118 bool BindParameter(int index, vtkTypeUInt64 value);
00119 bool BindParameter(int index, vtkTypeInt64 value);
00120
00121 bool BindParameter(int index, float value);
00122 bool BindParameter(int index, double value);
00123
00124
00125 bool BindParameter(int index, const char *stringValue);
00126
00127
00128 bool BindParameter(int index, const char *stringValue, size_t length);
00129
00130 bool BindParameter(int index, const vtkStdString &string);
00131
00132 bool BindParameter(int index, vtkVariant value);
00133
00134
00135
00136
00137 bool BindParameter(int index, const void *data, size_t length);
00138 bool ClearParameterBindings();
00140
00141 protected:
00142 vtkSQLiteQuery();
00143 ~vtkSQLiteQuery();
00144
00145 vtkSetStringMacro(LastErrorText);
00146
00147 private:
00148 vtkSQLiteQuery(const vtkSQLiteQuery &);
00149 void operator=(const vtkSQLiteQuery &);
00150
00151 vtk_sqlite3_stmt *Statement;
00152 bool InitialFetch;
00153 int InitialFetchResult;
00154 char *LastErrorText;
00155 bool TransactionInProgress;
00156
00158
00160 bool BindIntegerParameter(int index, int value);
00161 bool BindDoubleParameter(int index, double value);
00162 bool BindInt64Parameter(int index, vtkTypeInt64 value);
00163 bool BindStringParameter(int index, const char *data, int length);
00164 bool BindBlobParameter(int index, const void *data, int length);
00166
00167 };
00168
00169 #endif // __vtkSQLiteQuery_h
00170