ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SqlDatabase.h File Reference
#include "FormatRestorer.h"
#include "StringUtility.h"
#include <boost/enable_shared_from_this.hpp>
#include <boost/shared_ptr.hpp>
#include <cassert>
#include <iomanip>
#include <stdexcept>
#include <stdint.h>
#include <string>
#include <sstream>
#include <vector>
Include dependency graph for SqlDatabase.h:

Go to the source code of this file.

Classes

class  SqlDatabase::NoColumn
 
class  SqlDatabase::Exception
 Exceptions thrown by database operations. More...
 
class  SqlDatabase::Connection
 Connection to a database. More...
 
class  SqlDatabase::Transaction
 Unit of work within a database. More...
 
class  SqlDatabase::Statement
 A database operation. More...
 
class  SqlDatabase::Statement::iterator
 Iterates over the result rows. More...
 
struct  SqlDatabase::ColumnTraits< typename >
 
struct  SqlDatabase::ColumnTraits< NoColumn >
 
class  SqlDatabase::Renderer< T >
 Renders a column value as a string. More...
 
class  SqlDatabase::Renderer< std::string >
 
struct  SqlDatabase::AddrRenderer
 Renders a rose_addr_t as a hexadecimal string. More...
 
struct  SqlDatabase::TimeRenderer
 Renders a time_t as a string. More...
 
class  SqlDatabase::PrePostRow< Table >
 Called before and after printing each row of a table. More...
 
class  SqlDatabase::Header< T >
 
class  SqlDatabase::Header< std::string >
 
class  SqlDatabase::Header< NoColumn >
 
class  SqlDatabase::RowSeparator< T >
 
class  SqlDatabase::RowSeparator< NoColumn >
 
class  SqlDatabase::Table< T00, T01, T02, T03, T04, T05, T06, T07, T08, T09, T10, T11, T12, T13, T14, T15 >
 In-memory representation of a database table. More...
 
struct  SqlDatabase::Table< T00, T01, T02, T03, T04, T05, T06, T07, T08, T09, T10, T11, T12, T13, T14, T15 >::Tuple
 One row of a table. More...
 
struct  SqlDatabase::Table< T00, T01, T02, T03, T04, T05, T06, T07, T08, T09, T10, T11, T12, T13, T14, T15 >::Renderers
 Functors for rendering column values. More...
 

Namespaces

 SqlDatabase
 Support for a variety of relational database drivers.
 

Constant Groups

 SqlDatabase
 Support for a variety of relational database drivers.
 

Typedefs

typedef boost::shared_ptr
< Connection > 
SqlDatabase::ConnectionPtr
 Smart pointer to a database connection. More...
 
typedef boost::shared_ptr
< Transaction > 
SqlDatabase::TransactionPtr
 Smart pointer to a transaction. More...
 
typedef boost::shared_ptr
< Statement > 
SqlDatabase::StatementPtr
 Smart pointer to a statement. More...
 

Enumerations

enum  SqlDatabase::Driver {
  SqlDatabase::NO_DRIVER,
  SqlDatabase::SQLITE3,
  SqlDatabase::POSTGRESQL
}
 Low-level driver to use for the database. More...
 

Functions

template<>
std::string SqlDatabase::Statement::iterator::get< std::string > (size_t idx)
 
std::vector< std::string > SqlDatabase::split_sql (const std::string &sql)
 Split SQL source code into individual statements. More...
 
std::string SqlDatabase::escape (const std::string &, Driver, bool do_quote=true)
 Produce an SQL string literal from a C++ string. More...
 
bool SqlDatabase::is_valid_table_name (const std::string &name)
 Returns true if name is a valid table name. More...
 
template<class Container >
std::string SqlDatabase::in (const Container &values)
 Converts a container of values to an SQL "in" clause. More...
 
template<class Container , class Stringifier >
std::string SqlDatabase::in_numbers (const Container &values, Stringifier &stringifier)
 Converts a container of numbers to an SQL "in" clause using StringUtility to format them. More...
 
template<class Container >
std::string SqlDatabase::in_strings (const Container &values, Driver driver)
 Converts a container of strings to an SQL "in" clause of strings. More...
 
std::ostream & SqlDatabase::operator<< (std::ostream &, const NoColumn &)
 
std::ostream & SqlDatabase::operator<< (std::ostream &, const Exception &)
 
std::ostream & SqlDatabase::operator<< (std::ostream &, const Connection &)
 
std::ostream & SqlDatabase::operator<< (std::ostream &, const Transaction &)
 
std::ostream & SqlDatabase::operator<< (std::ostream &, const Statement &)
 

Variables

AddrRenderer SqlDatabase::addr8Renderer
 Renders 8-bit addresses in hexadecimal. More...
 
AddrRenderer SqlDatabase::addr16Renderer
 Renders 16-bit addresses in hexadecimal. More...
 
AddrRenderer SqlDatabase::addr32Renderer
 Renders 32-bit addresses in hexadecimal. More...
 
AddrRenderer SqlDatabase::addr64Renderer
 Renders 64-bit addresses in hexadecimal. More...
 
TimeRenderer SqlDatabase::timeRenderer
 Renders time_t as YYYY-MM-DD HH:MM:SS in the local timezone. More...
 
TimeRenderer SqlDatabase::dateRenderer
 Renders only the date portion of a time as YYYY-MM-DD in local timezone. More...
 
TimeRenderer SqlDatabase::humanTimeRenderer
 Renders a time using the current locale, which is more human-friendly. More...