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 vtkTypeRevisionMacro(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
00095
00097
00098 vtkVariant DataValue(vtkIdType c);
00099
00101
00103 const char* GetLastErrorText();
00104
00106
00111 using vtkSQLQuery::BindParameter;
00112 bool BindParameter(int index, unsigned char value);
00113 bool BindParameter(int index, signed char value);
00114 bool BindParameter(int index, unsigned short value);
00115 bool BindParameter(int index, short value);
00116 bool BindParameter(int index, unsigned int value);
00118
00119 bool BindParameter(int index, int value);
00120
00121 bool BindParameter(int index, unsigned long value);
00122 bool BindParameter(int index, long value);
00123 bool BindParameter(int index, vtkTypeUInt64 value);
00124 bool BindParameter(int index, vtkTypeInt64 value);
00125
00126 bool BindParameter(int index, float value);
00127 bool BindParameter(int index, double value);
00129
00130 bool BindParameter(int index, const char *stringValue);
00131
00132
00133 bool BindParameter(int index, const char *stringValue, size_t length);
00135
00136 bool BindParameter(int index, const vtkStdString &string);
00137 bool BindParameter(int index, vtkVariant value);
00138
00140
00142 bool BindParameter(int index, const void *data, size_t length);
00143 bool ClearParameterBindings();
00145
00146 protected:
00147 vtkSQLiteQuery();
00148 ~vtkSQLiteQuery();
00149
00150 vtkSetStringMacro(LastErrorText);
00151
00152 private:
00153 vtkSQLiteQuery(const vtkSQLiteQuery &);
00154 void operator=(const vtkSQLiteQuery &);
00155
00156 vtk_sqlite3_stmt *Statement;
00157 bool InitialFetch;
00158 int InitialFetchResult;
00159 char *LastErrorText;
00160 bool TransactionInProgress;
00161
00163
00165 bool BindIntegerParameter(int index, int value);
00166 bool BindDoubleParameter(int index, double value);
00167 bool BindInt64Parameter(int index, vtkTypeInt64 value);
00168 bool BindStringParameter(int index, const char *data, int length);
00169 bool BindBlobParameter(int index, const void *data, int length);
00171
00172 };
00173
00174 #endif // __vtkSQLiteQuery_h
00175