![]() |
aGrUM
0.16.0
|
Class for parsing SQL results using Nanodbc. More...
#include <nanodbcParser.h>
Public Member Functions | |
Constructors / Destructors | |
NanodbcParser (const ALLOC< std::string > &alloc=ALLOC< std::string >()) | |
Default constructor: create a parser without being connected. More... | |
NanodbcParser (nanodbc::connection &connection, const std::string &query, const ALLOC< std::string > &alloc=ALLOC< std::string >()) | |
constructor that executes an SQL query if the connection is active More... | |
virtual | ~NanodbcParser () |
destructor More... | |
Accessors / Modifiers | |
bool | next () |
Gets the next line of the SQL stream and parses it. More... | |
const std::vector< std::string, ALLOC< std::string > > & | current () const |
returns the current parsed line. More... | |
std::size_t | nbLine () const |
returns the current line number within the query More... | |
std::size_t | nbColumns () const |
returns the number of columns in the query result More... | |
std::string | columnName (const std::size_t i) const |
returns the name of the ith column More... | |
void | useNewQuery (nanodbc::connection &connexion, const std::string &query) |
start a new query More... | |
Public Types | |
using | allocator_type = ALLOC< std::string > |
type for the allocators passed in arguments of methods More... | |
Class for parsing SQL results using Nanodbc.
This class should probably not be used by itself. It is essentially used by Class DBInitializerFromSQL.
Definition at line 54 of file nanodbcParser.h.
using gum::learning::NanodbcParser< ALLOC >::allocator_type = ALLOC<std::string> |
type for the allocators passed in arguments of methods
Definition at line 58 of file nanodbcParser.h.
gum::learning::NanodbcParser< ALLOC >::NanodbcParser | ( | const ALLOC< std::string > & | alloc = ALLOC< std::string >() | ) |
Default constructor: create a parser without being connected.
gum::learning::NanodbcParser< ALLOC >::NanodbcParser | ( | nanodbc::connection & | connection, |
const std::string & | query, | ||
const ALLOC< std::string > & | alloc = ALLOC< std::string >() |
||
) |
constructor that executes an SQL query if the connection is active
connection | a nanODBC connection to a SQL database |
query | a string containing an SQL query |
alloc | The allocator that will be used by all methods |
|
virtual |
destructor
std::string gum::learning::NanodbcParser< ALLOC >::columnName | ( | const std::size_t | i | ) | const |
returns the name of the ith column
const std::vector<std::string,ALLOC<std::string> >& gum::learning::NanodbcParser< ALLOC >::current | ( | ) | const |
returns the current parsed line.
NullElement | is raised if there is no data. |
std::size_t gum::learning::NanodbcParser< ALLOC >::nbColumns | ( | ) | const |
returns the number of columns in the query result
std::size_t gum::learning::NanodbcParser< ALLOC >::nbLine | ( | ) | const |
returns the current line number within the query
bool gum::learning::NanodbcParser< ALLOC >::next | ( | ) |
Gets the next line of the SQL stream and parses it.
void gum::learning::NanodbcParser< ALLOC >::useNewQuery | ( | nanodbc::connection & | connexion, |
const std::string & | query | ||
) |
start a new query