• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

dox/IO/vtkSQLiteDatabase.h

Go to the documentation of this file.
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(const char* password);
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 
00129   virtual bool ParseURL(const char* url);
00130 
00131 private:
00132   vtk_sqlite3 *SQLiteInstance;
00133   
00134   // We want this to be private, a user of this class
00135   // should not be setting this for any reason
00136   vtkSetStringMacro(DatabaseType);
00137   
00138   char* DatabaseType;
00139   char* DatabaseFileName;
00140   
00141   vtkSQLiteDatabase(const vtkSQLiteDatabase &); // Not implemented.
00142   void operator=(const vtkSQLiteDatabase &); // Not implemented.
00143 };
00144 
00145 #endif // __vtkSQLiteDatabase_h
00146 

Generated by  doxygen 1.7.1