Logo ROOT  
Reference Guide
TSQLiteResult.h
Go to the documentation of this file.
1 // @(#)root/sqlite:$Id$
2 // Author: o.freyermuth <o.f@cern.ch>, 01/06/2013
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TSQLiteResult
13 #define ROOT_TSQLiteResult
14 
15 #include "TSQLResult.h"
16 
17 class sqlite3_stmt;
18 
19 class TSQLiteResult : public TSQLResult {
20 
21 private:
22  sqlite3_stmt *fResult{nullptr}; // query result (rows)
23 
24  Bool_t IsValid(Int_t field);
25 
26 public:
27  TSQLiteResult(void *result);
29 
30  void Close(Option_t *opt="") final;
31  Int_t GetFieldCount() final;
32  const char *GetFieldName(Int_t field) final;
33  Int_t GetRowCount() const final;
34  TSQLRow *Next() final;
35 
36  ClassDefOverride(TSQLiteResult, 0) // SQLite query result
37 };
38 
39 #endif
Option_t
const char Option_t
Definition: RtypesCore.h:66
TSQLiteResult::~TSQLiteResult
~TSQLiteResult()
Cleanup SQLite query result.
Definition: TSQLiteResult.cxx:33
Int_t
int Int_t
Definition: RtypesCore.h:45
ClassDefOverride
#define ClassDefOverride(name, id)
Definition: Rtypes.h:329
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TSQLResult
Definition: TSQLResult.h:32
TSQLiteResult::IsValid
Bool_t IsValid(Int_t field)
Check if result set is open and field index within range.
Definition: TSQLiteResult.cxx:54
TSQLRow
Definition: TSQLRow.h:30
TSQLiteResult::fResult
sqlite3_stmt * fResult
Definition: TSQLiteResult.h:22
TSQLiteResult::Next
TSQLRow * Next() final
Get next query result row.
Definition: TSQLiteResult.cxx:104
TSQLiteResult::GetRowCount
Int_t GetRowCount() const final
SQLite can not determine the row count for a Query, return -1 instead.
Definition: TSQLiteResult.cxx:95
TSQLiteResult::GetFieldCount
Int_t GetFieldCount() final
Get number of fields in result.
Definition: TSQLiteResult.cxx:70
TSQLiteResult::TSQLiteResult
TSQLiteResult(void *result)
SQLite query result.
Definition: TSQLiteResult.cxx:22
TSQLiteResult::GetFieldName
const char * GetFieldName(Int_t field) final
Get name of specified field.
Definition: TSQLiteResult.cxx:82
TSQLResult.h
TSQLiteResult
Definition: TSQLiteResult.h:19
TSQLiteResult::Close
void Close(Option_t *opt="") final
Close query result.
Definition: TSQLiteResult.cxx:42