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#if !defined(__CINT__)
18#include <sqlite3.h>
19#else
20struct sqlite3_stmt;
21#endif
22
23
24class TSQLiteResult : public TSQLResult {
25
26private:
27 sqlite3_stmt *fResult; // query result (rows)
28
29 Bool_t IsValid(Int_t field);
30
31public:
32 TSQLiteResult(void *result);
34
35 void Close(Option_t *opt="");
37 const char *GetFieldName(Int_t field);
38 Int_t GetRowCount() const;
39 TSQLRow *Next();
40
41 ClassDef(TSQLiteResult, 0) // SQLite query result
42};
43
44#endif
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
Int_t GetFieldCount()
Get number of fields in result.
sqlite3_stmt * fResult
Definition: TSQLiteResult.h:27
TSQLRow * Next()
Get next query result row.
void Close(Option_t *opt="")
Close query result.
const char * GetFieldName(Int_t field)
Get name of specified field.
~TSQLiteResult()
Cleanup SQLite query result.
Int_t GetRowCount() const
SQLite can not determine the row count for a Query, return -1 instead.
Bool_t IsValid(Int_t field)
Check if result set is open and field index within range.
TSQLiteResult(void *result)
SQLite query result.