CYCLUS
Public Types | Public Member Functions | List of all members
cyclus::SqlStatement Class Reference

Detailed Description

Thin wrapper class over sqlite3 prepared statements.

See http://sqlite.org/cintro.html for an overview of how prepared statements work.

Definition at line 22 of file sqlite_db.h.

#include <sqlite_db.h>

Public Types

typedef boost::shared_ptr< SqlStatementPtr
 

Public Member Functions

void BindBlob (int i, const void *val, int n)
 
void BindDouble (int i, double val)
 
void BindInt (int i, int val)
 
void BindText (int i, const char *val)
 
void Exec ()
 
double GetDouble (int col)
 
int GetInt (int col)
 
char * GetText (int col, int *n)
 
void Reset ()
 
bool Step ()
 
 ~SqlStatement ()
 

Member Typedef Documentation

◆ Ptr

typedef boost::shared_ptr<SqlStatement> cyclus::SqlStatement::Ptr

Definition at line 25 of file sqlite_db.h.

Constructor & Destructor Documentation

◆ ~SqlStatement()

cyclus::SqlStatement::~SqlStatement ( )

Definition at line 12 of file sqlite_db.cc.

Member Function Documentation

◆ BindBlob()

void cyclus::SqlStatement::BindBlob ( int  i,
const void *  val,
int  n 
)

Binds the templated sql parameter at index i to the value pointed to by val.

n is the length in bytes of the value.

Definition at line 64 of file sqlite_db.cc.

◆ BindDouble()

void cyclus::SqlStatement::BindDouble ( int  i,
double  val 
)

Binds the templated sql parameter at index i to val.

Definition at line 56 of file sqlite_db.cc.

◆ BindInt()

void cyclus::SqlStatement::BindInt ( int  i,
int  val 
)

Binds the templated sql parameter at index i to val.

Definition at line 52 of file sqlite_db.cc.

◆ BindText()

void cyclus::SqlStatement::BindText ( int  i,
const char *  val 
)

Binds the templated sql parameter at index i to val.

Definition at line 60 of file sqlite_db.cc.

◆ Exec()

void cyclus::SqlStatement::Exec ( )

Executes the prepared statement.

Definition at line 16 of file sqlite_db.cc.

◆ GetDouble()

double cyclus::SqlStatement::GetDouble ( int  col)

Returns a double value for the specified column of the current query row.

Definition at line 39 of file sqlite_db.cc.

◆ GetInt()

int cyclus::SqlStatement::GetInt ( int  col)

Returns an int value for the specified column of the current query row.

Definition at line 35 of file sqlite_db.cc.

◆ GetText()

char * cyclus::SqlStatement::GetText ( int  col,
int *  n 
)

Returns a byte array value for the specified column of the current query row.

This can be used for retrieving TEXT and BLOB column data.

Definition at line 43 of file sqlite_db.cc.

◆ Reset()

void cyclus::SqlStatement::Reset ( )

Executes the prepared statement.

Definition at line 21 of file sqlite_db.cc.

◆ Step()

bool cyclus::SqlStatement::Step ( )

Step to next row of previously executed query.

Returns false when there are no more rows. Previously retrieved text or blob column data memory is deallocated.

Definition at line 26 of file sqlite_db.cc.


The documentation for this class was generated from the following files: