dbixx::row Class Reference

This class represents a single row that is fetched from the DB. More...

#include <dbixx.h>

List of all members.

Public Member Functions

 row ()
dbi_result get_dbi_result ()
bool isempty ()
bool isnull (int inx)
bool isnull (std::string const &id)
bool fetch (int pos, short &value)
bool fetch (int pos, unsigned short &value)
bool fetch (int pos, int &value)
bool fetch (int pos, unsigned &value)
bool fetch (int pos, long &value)
bool fetch (int pos, unsigned long &value)
bool fetch (int pos, long long &value)
bool fetch (int pos, unsigned long long &value)
bool fetch (int pos, float &value)
bool fetch (int pos, double &value)
bool fetch (int pos, long double &value)
bool fetch (int pos, std::string &value)
bool fetch (int pos, std::tm &value)
bool operator[] (std::string const &id)
bool operator[] (int ind)
template<typename T>
rowoperator>> (T &v)
unsigned int cols ()
template<typename T>
get (int col)

Friends

class session
class result


Detailed Description

This class represents a single row that is fetched from the DB.

Constructor & Destructor Documentation

dbixx::row::row (  )  [inline]

Creates an empty row


Member Function Documentation

dbi_result dbixx::row::get_dbi_result (  )  [inline]

Get underlying libdbi object. For low level access

bool dbixx::row::isempty (  ) 

Check if this row has some data or not

bool dbixx::row::isnull ( int  inx  ) 

Check if the column at position indx has NULL value, first column index is 1

bool dbixx::row::isnull ( std::string const &  id  ) 

Check if the column named id has NULL value

bool dbixx::row::fetch ( int  pos,
short &  value 
)

Fetch value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::fetch ( int  pos,
unsigned short &  value 
)

Fetch value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::fetch ( int  pos,
int &  value 
)

Fetch value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::fetch ( int  pos,
unsigned &  value 
)

Fetch value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::fetch ( int  pos,
long &  value 
)

Fetch value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::fetch ( int  pos,
unsigned long &  value 
)

Fetch value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::fetch ( int  pos,
long long &  value 
)

Fetch value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::fetch ( int  pos,
unsigned long long &  value 
)

Fetch value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::fetch ( int  pos,
float &  value 
)

Fetch value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::fetch ( int  pos,
double &  value 
)

Fetch value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::fetch ( int  pos,
long double &  value 
)

Fetch value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::fetch ( int  pos,
std::string &  value 
)

Fetch string value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::fetch ( int  pos,
std::tm &  value 
)

Fetch time value at position pos (starting from 1), returns false if the column has null value.

bool dbixx::row::operator[] ( std::string const &  id  )  [inline]

Syntactic sugar for isnull(id)

bool dbixx::row::operator[] ( int  ind  )  [inline]

Syntactic sugar for isnull(id)

template<typename T>
row& dbixx::row::operator>> ( T &  v  )  [inline]

Fetch a value v from the row starting with first column. Each next call updates the internal pointer to next column in row

unsigned int dbixx::row::cols (  ) 

Get number of columns in the row

template<typename T>
T dbixx::row::get ( int  col  )  [inline]

Fetch value by column. It fetches the value from column col (starting from 1) and returns it. If the column is null it throws dbixx_error


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

Generated on Mon Dec 13 21:46:02 2010 for DbiXX by  doxygen 1.5.6