VTK  9.1.0
vtkQtSQLQuery.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkQtSQLQuery.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15/*-------------------------------------------------------------------------
16 Copyright 2008 Sandia Corporation.
17 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18 the U.S. Government retains certain rights in this software.
19-------------------------------------------------------------------------*/
28#ifndef vtkQtSQLQuery_h
29#define vtkQtSQLQuery_h
30
31#include "vtkGUISupportQtSQLModule.h" // For export macro
32#include "vtkSQLQuery.h"
33
34class vtkVariant;
35class vtkQtSQLQueryInternals;
36
37class VTKGUISUPPORTQTSQL_EXPORT vtkQtSQLQuery : public vtkSQLQuery
38{
39public:
40 static vtkQtSQLQuery* New();
41 vtkTypeMacro(vtkQtSQLQuery, vtkSQLQuery);
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
49 bool Execute() override;
50
54 int GetNumberOfFields() override;
55
59 const char* GetFieldName(int col) override;
60
64 int GetFieldType(int col) override;
65
69 bool NextRow() override;
70
75
79 bool HasError() override;
80
84 const char* GetLastErrorText() override;
85
86protected:
88 ~vtkQtSQLQuery() override;
89
90 vtkQtSQLQueryInternals* Internals;
91 friend class vtkQtSQLDatabase;
92
93private:
94 // Using the convenience function internally
95 vtkSetStringMacro(LastErrorText);
96
97 char* LastErrorText;
98
99 vtkQtSQLQuery(const vtkQtSQLQuery&) = delete;
100 void operator=(const vtkQtSQLQuery&) = delete;
101};
102
103#endif // vtkQtSQLQuery_h
a simple class to control print indentation
Definition: vtkIndent.h:113
maintains a connection to an sql database
friend class vtkQtSQLQuery
query class associated with vtkQtSQLDatabase
Definition: vtkQtSQLQuery.h:38
vtkVariant DataValue(vtkIdType c) override
Return data in current row, field c.
~vtkQtSQLQuery() override
const char * GetFieldName(int col) override
Return the name of the specified query field.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetNumberOfFields() override
The number of fields in the query result.
static vtkQtSQLQuery * New()
const char * GetLastErrorText() override
Get the last error text from the query.
int GetFieldType(int col) override
Return the type of the specified query field, as defined in vtkType.h.
vtkQtSQLQueryInternals * Internals
Definition: vtkQtSQLQuery.h:90
bool Execute() override
Execute the query.
bool HasError() override
Returns true if an error is set, otherwise false.
bool NextRow() override
Advance row, return false if past end.
executes an sql query and retrieves results
Definition: vtkSQLQuery.h:69
A atomic type representing the union of many types.
Definition: vtkVariant.h:145
int vtkIdType
Definition: vtkType.h:332