Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

Dv::MySql::Command_ Class Reference

Implementation class for Sql::Command helper. More...

#include <mysqldb.h>

Inheritance diagram for Dv::MySql::Command_:

Inheritance graph
[legend]
Collaboration diagram for Dv::MySql::Command_:

Collaboration graph
[legend]
List of all members.

Private Member Functions

 Command_ (Db &db, Sql::Command &cmd)
virtual ~Command_ ()
 Destructor, virtual because it will be subclassed.

bool check_error ()
 Return true iff all is well.

void sync (unsigned int r) throw (Sql::Exception)
 Synchronize mrow_ cursor to point to row # r.

int error () const
 Return error code.

Dbdb ()
 Return MySql::Db connection of this command.

bool exec () throw (Sql::Exception)
 Execute current command.

void fetch (std::vector< std::string > &, unsigned int r) throw (Sql::Exception)
 Fetch r'th row from query result.

void fetch (std::string &, unsigned int r, unsigned int c) throw (Sql::Exception)
 Fetch c'th element in r'th row of query result.

void escape (const std::string &)
 Write quoted and escaped version of parameter to textstream().

const std::vector< Sql::Field > & fields ()
 Return field description corresponding to query result.

unsigned int insertid () const
 Return auto_increment insertid of last query.


Private Attributes

Dbdb_
void * result_
 Stored result of query, opaque declaration, really MYSQL_RES*.

int row_
 Current row# [0..] of mrow_, -1 if none.

unsigned long * lengths_
 Lengths of fields [0..ncols()] in current row.

void * mrow_
 Buffer corresponding to row_; opaque declaration, really MYSQL_ROW.

int errno_
 Error code, 0 if ok.

std::vector< Sql::Fieldfields_
 Field list of the query result, filled on demand.


Friends

class Db
 Only Db can e.g. construct a Command_.


Detailed Description

Implementation class for Sql::Command helper.

Definition at line 125 of file mysqldb.h.


Constructor & Destructor Documentation

Dv::MySql::Command_::Command_ Db db,
Sql::Command cmd
[private]
 

virtual Dv::MySql::Command_::~Command_  )  [private, virtual]
 

Destructor, virtual because it will be subclassed.

Reimplemented from Dv::Sql::Command_.


Member Function Documentation

bool Dv::MySql::Command_::check_error  )  [private]
 

Return true iff all is well.

void Dv::MySql::Command_::sync unsigned int  r  )  throw (Sql::Exception) [private]
 

Synchronize mrow_ cursor to point to row # r.

int Dv::MySql::Command_::error  )  const [inline, private]
 

Return error code.

Definition at line 153 of file mysqldb.h.

References errno_.

Db& Dv::MySql::Command_::db  )  [inline, private, virtual]
 

Return MySql::Db connection of this command.

Implements Dv::Sql::Command_.

Definition at line 155 of file mysqldb.h.

References db_.

bool Dv::MySql::Command_::exec  )  throw (Sql::Exception) [private, virtual]
 

Execute current command.

Part of Sql::Command_ required interface.

Implements Dv::Sql::Command_.

void Dv::MySql::Command_::fetch std::vector< std::string > &  ,
unsigned int  r
throw (Sql::Exception) [private, virtual]
 

Fetch r'th row from query result.

Part of Sql::Command_ required interface.

Implements Dv::Sql::Command_.

void Dv::MySql::Command_::fetch std::string &  ,
unsigned int  r,
unsigned int  c
throw (Sql::Exception) [private, virtual]
 

Fetch c'th element in r'th row of query result.

Part of Sql::Command_ required interface.

Reimplemented from Dv::Sql::Command_.

void Dv::MySql::Command_::escape const std::string &   )  [private, virtual]
 

Write quoted and escaped version of parameter to textstream().

Part of Sql::Command_ required interface.

Reimplemented from Dv::Sql::Command_.

const std::vector<Sql::Field>& Dv::MySql::Command_::fields  )  [private, virtual]
 

Return field description corresponding to query result.

Part of Sql::Command_ required interface.

Implements Dv::Sql::Command_.

unsigned int Dv::MySql::Command_::insertid  )  const [private, virtual]
 

Return auto_increment insertid of last query.

Reimplemented from Dv::Sql::Command_.


Friends And Related Function Documentation

friend class Db [friend]
 

Only Db can e.g. construct a Command_.

Definition at line 128 of file mysqldb.h.


Member Data Documentation

Db& Dv::MySql::Command_::db_ [private]
 

Definition at line 131 of file mysqldb.h.

Referenced by db().

void* Dv::MySql::Command_::result_ [private]
 

Stored result of query, opaque declaration, really MYSQL_RES*.

Definition at line 133 of file mysqldb.h.

int Dv::MySql::Command_::row_ [private]
 

Current row# [0..] of mrow_, -1 if none.

Definition at line 135 of file mysqldb.h.

unsigned long* Dv::MySql::Command_::lengths_ [private]
 

Lengths of fields [0..ncols()] in current row.

Definition at line 137 of file mysqldb.h.

void* Dv::MySql::Command_::mrow_ [private]
 

Buffer corresponding to row_; opaque declaration, really MYSQL_ROW.

Definition at line 139 of file mysqldb.h.

int Dv::MySql::Command_::errno_ [private]
 

Error code, 0 if ok.

Definition at line 141 of file mysqldb.h.

Referenced by error().

std::vector<Sql::Field> Dv::MySql::Command_::fields_ [private]
 

Field list of the query result, filled on demand.

Definition at line 143 of file mysqldb.h.


The documentation for this class was generated from the following file:
dvmysql-0.4.11 [15 February, 2004]