OpenStudio:utilities
Loading...
Searching...
No Matches
openstudio::PreparedStatement Class Reference

#include <PreparedStatement.hpp>

Public Member Functions

bool bind (int position, bool val)
 
bool bind (int position, char val)=delete
 
bool bind (int position, const char *s)
 char* to std::string.
 
bool bind (int position, const std::string &t_str)
 
bool bind (int position, const std::wstring &w)
 wstring to std::string.
 
bool bind (int position, const wchar_t *w)
 wchar_t* to std::string.
 
bool bind (int position, double val)
 
bool bind (int position, int val)
 
bool bind (int position, unsigned int val)
 
template<typename... Args>
bool bindAll (Args &&... args)
 
boost::optional< double > execAndReturnFirstDouble () const
 
boost::optional< intexecAndReturnFirstInt () const
 
boost::optional< std::string > execAndReturnFirstString () const
 
boost::optional< std::vector< double > > execAndReturnVectorOfDouble () const
 execute a statement and return the results (if any) in a vector of double
 
boost::optional< std::vector< int > > execAndReturnVectorOfInt () const
 execute a statement and return the results (if any) in a vector of int
 
boost::optional< std::vector< std::string > > execAndReturnVectorOfString () const
 execute a statement and return the results (if any) in a vector of string
 
void execAndThrowOnError ()
 
int execute ()
 
PreparedStatementoperator= (const PreparedStatement &)=delete
 
 PreparedStatement (const PreparedStatement &)=delete
 
template<typename... Args>
 PreparedStatement (const std::string &t_stmt, sqlite3 *t_db, bool t_transaction, Args &&... args)
 
 PreparedStatement (const std::string &t_stmt, sqlite3 *t_db, bool t_transaction=false)
 
 ~PreparedStatement ()
 

Static Public Member Functions

static std::string columnText (const unsigned char *column)
 
static int get_sqlite3_bind_parameter_count (sqlite3_stmt *statement)
 

Constructor & Destructor Documentation

◆ PreparedStatement() [1/3]

openstudio::PreparedStatement::PreparedStatement ( const PreparedStatement & )
delete

◆ PreparedStatement() [2/3]

openstudio::PreparedStatement::PreparedStatement ( const std::string & t_stmt,
sqlite3 * t_db,
bool t_transaction = false )
inline

◆ PreparedStatement() [3/3]

template<typename... Args>
openstudio::PreparedStatement::PreparedStatement ( const std::string & t_stmt,
sqlite3 * t_db,
bool t_transaction,
Args &&... args )
inline

◆ ~PreparedStatement()

openstudio::PreparedStatement::~PreparedStatement ( )

Member Function Documentation

◆ bind() [1/9]

bool openstudio::PreparedStatement::bind ( int position,
bool val )
inline

◆ bind() [2/9]

bool openstudio::PreparedStatement::bind ( int position,
char val )
delete

◆ bind() [3/9]

bool openstudio::PreparedStatement::bind ( int position,
const char * s )
inline

char* to std::string.

◆ bind() [4/9]

bool openstudio::PreparedStatement::bind ( int position,
const std::string & t_str )

◆ bind() [5/9]

bool openstudio::PreparedStatement::bind ( int position,
const std::wstring & w )
inline

wstring to std::string.

◆ bind() [6/9]

bool openstudio::PreparedStatement::bind ( int position,
const wchar_t * w )
inline

wchar_t* to std::string.

◆ bind() [7/9]

bool openstudio::PreparedStatement::bind ( int position,
double val )

◆ bind() [8/9]

bool openstudio::PreparedStatement::bind ( int position,
int val )

◆ bind() [9/9]

bool openstudio::PreparedStatement::bind ( int position,
unsigned int val )

◆ bindAll()

template<typename... Args>
bool openstudio::PreparedStatement::bindAll ( Args &&... args)
inline

◆ columnText()

static std::string openstudio::PreparedStatement::columnText ( const unsigned char * column)
inlinestatic

◆ execAndReturnFirstDouble()

boost::optional< double > openstudio::PreparedStatement::execAndReturnFirstDouble ( ) const
nodiscard

◆ execAndReturnFirstInt()

boost::optional< int > openstudio::PreparedStatement::execAndReturnFirstInt ( ) const
nodiscard

◆ execAndReturnFirstString()

boost::optional< std::string > openstudio::PreparedStatement::execAndReturnFirstString ( ) const
nodiscard

◆ execAndReturnVectorOfDouble()

boost::optional< std::vector< double > > openstudio::PreparedStatement::execAndReturnVectorOfDouble ( ) const
nodiscard

execute a statement and return the results (if any) in a vector of double

◆ execAndReturnVectorOfInt()

boost::optional< std::vector< int > > openstudio::PreparedStatement::execAndReturnVectorOfInt ( ) const
nodiscard

execute a statement and return the results (if any) in a vector of int

◆ execAndReturnVectorOfString()

boost::optional< std::vector< std::string > > openstudio::PreparedStatement::execAndReturnVectorOfString ( ) const
nodiscard

execute a statement and return the results (if any) in a vector of string

◆ execAndThrowOnError()

void openstudio::PreparedStatement::execAndThrowOnError ( )
inline

◆ execute()

int openstudio::PreparedStatement::execute ( )

◆ get_sqlite3_bind_parameter_count()

static int openstudio::PreparedStatement::get_sqlite3_bind_parameter_count ( sqlite3_stmt * statement)
staticnodiscard

◆ operator=()

PreparedStatement & openstudio::PreparedStatement::operator= ( const PreparedStatement & )
delete