00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkMySQLQuery.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 =========================================================================*/ 00028 #ifndef __vtkMySQLQuery_h 00029 #define __vtkMySQLQuery_h 00030 00031 #include "vtkSQLQuery.h" 00032 00033 class vtkMySQLDatabase; 00034 class vtkVariant; 00035 class vtkVariantArray; 00036 class vtkMySQLQueryInternals; 00037 00038 class VTK_IO_EXPORT vtkMySQLQuery : public vtkSQLQuery 00039 { 00040 //BTX 00041 friend class vtkMySQLDatabase; 00042 //ETX 00043 00044 public: 00045 vtkTypeRevisionMacro(vtkMySQLQuery, vtkSQLQuery); 00046 void PrintSelf(ostream& os, vtkIndent indent); 00047 static vtkMySQLQuery *New(); 00048 00051 bool Execute(); 00052 00054 int GetNumberOfFields(); 00055 00057 const char* GetFieldName(int i); 00058 00061 int GetFieldType(int i); 00062 00064 bool NextRow(); 00065 00067 bool HasError(); 00068 00069 //BTX 00071 00072 vtkVariant DataValue(vtkIdType c); 00073 //ETX 00075 00077 const char* GetLastErrorText(); 00078 00079 //BTX 00081 00082 virtual vtkStdString EscapeString( vtkStdString src, bool addSurroundingQuotes = true ); 00083 //ETX 00085 00086 protected: 00087 vtkMySQLQuery(); 00088 ~vtkMySQLQuery(); 00089 00090 vtkSetStringMacro(LastErrorText); 00091 00092 private: 00093 vtkMySQLQuery(const vtkMySQLQuery &); // Not implemented. 00094 void operator=(const vtkMySQLQuery &); // Not implemented. 00095 00096 vtkMySQLQueryInternals *Internals; 00097 bool InitialFetch; 00098 char *LastErrorText; 00099 }; 00100 00101 #endif // __vtkMySQLQuery_h 00102