00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkSQLiteDatabase.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00048 #ifndef __vtkSQLiteDatabase_h 00049 #define __vtkSQLiteDatabase_h 00050 00051 #include "vtkSQLDatabase.h" 00052 00053 class vtkSQLQuery; 00054 class vtkSQLiteQuery; 00055 class vtkStringArray; 00056 struct vtk_sqlite3; 00057 00058 class VTK_IO_EXPORT vtkSQLiteDatabase : public vtkSQLDatabase 00059 { 00060 //BTX 00061 friend class vtkSQLiteQuery; 00062 //ETX 00063 00064 public: 00065 vtkTypeRevisionMacro(vtkSQLiteDatabase, vtkSQLDatabase); 00066 void PrintSelf(ostream& os, vtkIndent indent); 00067 static vtkSQLiteDatabase *New(); 00068 00072 bool Open(); 00073 00075 void Close(); 00076 00078 bool IsOpen(); 00079 00081 vtkSQLQuery* GetQueryInstance(); 00082 00084 vtkStringArray* GetTables(); 00085 00087 vtkStringArray* GetRecord(const char *table); 00088 00090 bool IsSupported(int feature); 00091 00093 bool HasError(); 00094 00096 const char* GetLastErrorText(); 00097 00099 00100 vtkGetStringMacro(DatabaseType); 00102 00104 00105 vtkGetStringMacro(DatabaseFileName); 00106 vtkSetStringMacro(DatabaseFileName); 00108 00110 virtual vtkStdString GetURL(); 00111 00113 00117 virtual vtkStdString GetColumnSpecification( vtkSQLDatabaseSchema* schema, 00118 int tblHandle, 00119 int colHandle ); 00121 00122 protected: 00123 vtkSQLiteDatabase(); 00124 ~vtkSQLiteDatabase(); 00125 00126 private: 00127 vtk_sqlite3 *SQLiteInstance; 00128 00129 // We want this to be private, a user of this class 00130 // should not be setting this for any reason 00131 vtkSetStringMacro(DatabaseType); 00132 00133 char* DatabaseType; 00134 char* DatabaseFileName; 00135 00136 vtkSQLiteDatabase(const vtkSQLiteDatabase &); // Not implemented. 00137 void operator=(const vtkSQLiteDatabase &); // Not implemented. 00138 }; 00139 00140 #endif // __vtkSQLiteDatabase_h 00141