OpenStudio:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Classes | Public Member Functions | Static Public Member Functions | List of all members
openstudio::PreparedStatement Class Reference

#include <PreparedStatement.hpp>

Public Member Functions

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

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

Member Function Documentation

bool openstudio::PreparedStatement::bind ( int  position,
const std::string &  t_str 
)
bool openstudio::PreparedStatement::bind ( int  position,
int  val 
)
bool openstudio::PreparedStatement::bind ( int  position,
unsigned int  val 
)
bool openstudio::PreparedStatement::bind ( int  position,
double  val 
)
bool openstudio::PreparedStatement::bind ( int  position,
char  val 
)
delete
bool openstudio::PreparedStatement::bind ( int  position,
const char *  s 
)
inline

char* to std::string.

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

wstring to std::string.

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

wchar_t* to std::string.

bool openstudio::PreparedStatement::bind ( int  position,
bool  val 
)
inline
template<typename... Args>
bool openstudio::PreparedStatement::bindAll ( Args &&...  args)
inline
static std::string openstudio::PreparedStatement::columnText ( const unsigned char *  column)
inlinestatic
boost::optional<double> openstudio::PreparedStatement::execAndReturnFirstDouble ( ) const
boost::optional<int> openstudio::PreparedStatement::execAndReturnFirstInt ( ) const
boost::optional<std::string> openstudio::PreparedStatement::execAndReturnFirstString ( ) const
boost::optional<std::vector<double> > openstudio::PreparedStatement::execAndReturnVectorOfDouble ( ) const

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

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

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

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

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

void openstudio::PreparedStatement::execAndThrowOnError ( )
inline
int openstudio::PreparedStatement::execute ( )
static int openstudio::PreparedStatement::get_sqlite3_bind_parameter_count ( sqlite3_stmt *  statement)
static
PreparedStatement& openstudio::PreparedStatement::operator= ( const PreparedStatement )
delete