SQLiteC++  0.5.0
SQLiteC++ is a smart and easy to use C++ SQLite3 wrapper.
 All Classes Namespaces Files Functions Friends Macros
SQLite::Column Class Reference

Encapsulation of a Column in a row of the result pointed by the prepared Statement. More...

#include <Column.h>

Public Member Functions

 Column (Statement::Ptr &aStmtPtr, int aIndex) throw ()
 Encapsulation of a Column in a Row of the result. More...
 
virtual ~Column (void) throw ()
 Simple destructor. More...
 
int getInt (void) const throw ()
 Return the integer value of the column. More...
 
sqlite3_int64 getInt64 (void) const throw ()
 Return the 64bits integer value of the column. More...
 
double getDouble (void) const throw ()
 Return the double (64bits float) value of the column. More...
 
const char * getText (void) const throw ()
 Return a pointer to the text value (NULL terminated string) of the column. More...
 
const void * getBlob (void) const throw ()
 Return a pointer to the binary blob value of the column. More...
 
int getType (void) const throw ()
 Return the type of the value of the column. More...
 
bool isInteger (void) const throw ()
 Test if the column is an integer type value (meaningfull only before any conversion) More...
 
bool isFloat (void) const throw ()
 Test if the column is a floting point type value (meaningfull only before any conversion) More...
 
bool isText (void) const throw ()
 Test if the column is a text type value (meaningfull only before any conversion) More...
 
bool isBlob (void) const throw ()
 Test if the column is a binary blob type value (meaningfull only before any conversion) More...
 
bool isNull (void) const throw ()
 Test if the column is NULL (meaningfull only before any conversion) More...
 
int getBytes (void) const throw ()
 Return the number of bytes used by the text (or blob) value of the column. More...
 
int size (void) const throw ()
 Alias returning the number of bytes used by the text (or blob) value of the column. More...
 
 operator int () const
 Inline cast operator to int. More...
 
 operator sqlite3_int64 () const
 Inline cast operator to 64bits integer. More...
 
 operator double () const
 Inline cast operator to double. More...
 
 operator const char * () const
 Inline cast operator to char*. More...
 
 operator const void * () const
 Inline cast operator to void*. More...
 
const char * errmsg (void) const
 Return UTF-8 encoded English language explanation of the most recent error. More...
 

Detailed Description

Encapsulation of a Column in a row of the result pointed by the prepared Statement.

A Column is a particular field of SQLite data in the current row of result of the Statement : it points to a single cell.

Its value can be expressed as a text, and, when applicable, as a numeric (integer or floting point) or a binary blob.

Definition at line 29 of file Column.h.

Constructor & Destructor Documentation

SQLite::Column::Column ( Statement::Ptr aStmtPtr,
int  aIndex 
) throw ()

Encapsulation of a Column in a Row of the result.

Parameters
[in]aStmtPtrShared pointer to the prepared SQLite Statement Object.
[in]aIndexIndex of the column in the row of result

Definition at line 18 of file Column.cpp.

SQLite::Column::~Column ( void  ) throw ()
virtual

Simple destructor.

Definition at line 25 of file Column.cpp.

Member Function Documentation

const char* SQLite::Column::errmsg ( void  ) const
inline

Return UTF-8 encoded English language explanation of the most recent error.

Definition at line 166 of file Column.h.

const void * SQLite::Column::getBlob ( void  ) const throw ()

Return a pointer to the binary blob value of the column.

Warning
The value pointed at is only valid while the statement is valid (ie. not finalized), thus you must copy it before using it beyond its scope (to a std::string for instance).

Definition at line 55 of file Column.cpp.

Here is the caller graph for this function:

int SQLite::Column::getBytes ( void  ) const throw ()

Return the number of bytes used by the text (or blob) value of the column.

Return either :

  • size in bytes (not in characters) of the string returned by getText() without the '\0' terminator
  • size in bytes of the string representation of the numerical value (integer or double)
  • size in bytes of the binary blob returned by getBlob()
  • 0 for a NULL value

Definition at line 67 of file Column.cpp.

Here is the caller graph for this function:

double SQLite::Column::getDouble ( void  ) const throw ()

Return the double (64bits float) value of the column.

Definition at line 43 of file Column.cpp.

Here is the caller graph for this function:

int SQLite::Column::getInt ( void  ) const throw ()

Return the integer value of the column.

Definition at line 31 of file Column.cpp.

Here is the caller graph for this function:

sqlite3_int64 SQLite::Column::getInt64 ( void  ) const throw ()

Return the 64bits integer value of the column.

Definition at line 37 of file Column.cpp.

Here is the caller graph for this function:

const char * SQLite::Column::getText ( void  ) const throw ()

Return a pointer to the text value (NULL terminated string) of the column.

Warning
The value pointed at is only valid while the statement is valid (ie. not finalized), thus you must copy it before using it beyond its scope (to a std::string for instance).

Definition at line 49 of file Column.cpp.

Here is the caller graph for this function:

int SQLite::Column::getType ( void  ) const throw ()

Return the type of the value of the column.

Return either SQLITE_INTEGER, SQLITE_FLOAT, SQLITE_TEXT, SQLITE_BLOB, or SQLITE_NULL.

Warning
After a type conversion (by a call to a getXxx on a Column of a Yyy type), the value returned by sqlite3_column_type() is undefined.

Definition at line 61 of file Column.cpp.

Here is the caller graph for this function:

bool SQLite::Column::isBlob ( void  ) const throw ()
inline

Test if the column is a binary blob type value (meaningfull only before any conversion)

Definition at line 92 of file Column.h.

Here is the call graph for this function:

bool SQLite::Column::isFloat ( void  ) const throw ()
inline

Test if the column is a floting point type value (meaningfull only before any conversion)

Definition at line 82 of file Column.h.

Here is the call graph for this function:

bool SQLite::Column::isInteger ( void  ) const throw ()
inline

Test if the column is an integer type value (meaningfull only before any conversion)

Definition at line 77 of file Column.h.

Here is the call graph for this function:

bool SQLite::Column::isNull ( void  ) const throw ()
inline

Test if the column is NULL (meaningfull only before any conversion)

Definition at line 97 of file Column.h.

Here is the call graph for this function:

bool SQLite::Column::isText ( void  ) const throw ()
inline

Test if the column is a text type value (meaningfull only before any conversion)

Definition at line 87 of file Column.h.

Here is the call graph for this function:

SQLite::Column::operator const char * ( ) const
inline

Inline cast operator to char*.

See Also
getText

Definition at line 139 of file Column.h.

Here is the call graph for this function:

SQLite::Column::operator const void * ( ) const
inline

Inline cast operator to void*.

See Also
getBlob

Definition at line 148 of file Column.h.

Here is the call graph for this function:

SQLite::Column::operator double ( ) const
inline

Inline cast operator to double.

Definition at line 130 of file Column.h.

Here is the call graph for this function:

SQLite::Column::operator int ( ) const
inline

Inline cast operator to int.

Definition at line 120 of file Column.h.

Here is the call graph for this function:

SQLite::Column::operator sqlite3_int64 ( ) const
inline

Inline cast operator to 64bits integer.

Definition at line 125 of file Column.h.

Here is the call graph for this function:

int SQLite::Column::size ( void  ) const throw ()
inline

Alias returning the number of bytes used by the text (or blob) value of the column.

Definition at line 114 of file Column.h.

Here is the call graph for this function:


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