VTK  9.3.20240424
vtkQtSQLQuery.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
12#ifndef vtkQtSQLQuery_h
13#define vtkQtSQLQuery_h
14
15#include "vtkGUISupportQtSQLModule.h" // For export macro
16#include "vtkSQLQuery.h"
17
18VTK_ABI_NAMESPACE_BEGIN
19class vtkVariant;
20class vtkQtSQLQueryInternals;
21
22class VTKGUISUPPORTQTSQL_EXPORT vtkQtSQLQuery : public vtkSQLQuery
23{
24public:
25 static vtkQtSQLQuery* New();
26 vtkTypeMacro(vtkQtSQLQuery, vtkSQLQuery);
27 void PrintSelf(ostream& os, vtkIndent indent) override;
28
34 bool Execute() override;
35
39 int GetNumberOfFields() override;
40
44 const char* GetFieldName(int col) override;
45
49 int GetFieldType(int col) override;
50
54 bool NextRow() override;
55
60
64 bool HasError() override;
65
69 const char* GetLastErrorText() override;
70
71protected:
73 ~vtkQtSQLQuery() override;
74
75 vtkQtSQLQueryInternals* Internals;
76 friend class vtkQtSQLDatabase;
77
78private:
79 // Using the convenience function internally
80 vtkSetStringMacro(LastErrorText);
81
82 char* LastErrorText;
83
84 vtkQtSQLQuery(const vtkQtSQLQuery&) = delete;
85 void operator=(const vtkQtSQLQuery&) = delete;
86};
87
88VTK_ABI_NAMESPACE_END
89#endif // vtkQtSQLQuery_h
a simple class to control print indentation
Definition vtkIndent.h:108
maintains a connection to an sql database
query class associated with vtkQtSQLDatabase
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
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:60
A type representing the union of many types.
Definition vtkVariant.h:162
int vtkIdType
Definition vtkType.h:315