Main | License | Installation | FAQ | Screenshots | Contact | Links | Sf.net | Freshmeat.net | KDE-Apps.org
Requirements | Design | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

MySQLResultRow Class Reference
[MySQL C++ Wrappers]

#include <mysqlResultRow.hpp>

Inheritance diagram for MySQLResultRow:
Inheritance graph
[legend]

Public Member Functions

 MySQLResultRow (MYSQL_ROW _result)
virtual std::string operator[] (int i) throw (Error)
 Destructor.
virtual void invalidate (void)

Protected Attributes

MYSQL_ROW result

Detailed Description

Class for accessing a single row of an SQL-query's result.

Date:
Thu Mar 03 2005
Author:
Jan Wedekind (wedesoft@users.sourceforge.net)

Definition at line 28 of file mysqlResultRow.hpp.


Constructor & Destructor Documentation

MySQLResultRow::MySQLResultRow ( MYSQL_ROW  _result  ) 

Constructor requiring a handle to a result-row. Use MySQLStatement::fetchRow instead of this constructor.

Definition at line 18 of file mysqlResultRow.cpp.

References result.

00019                                                  :
00020   result( _result )
00021 {
00022   assert( result );
}


Member Function Documentation

virtual void MySQLResultRow::invalidate ( void   )  [inline, virtual]

Invalidate the row. This method is called by the destructor of MySQLStatement to prevent the MySQLResultRow object from using invalidated data.

Implements ResultRow.

Definition at line 42 of file mysqlResultRow.hpp.

References result.

00042 { result = NULL; }

std::string MySQLResultRow::operator[] ( int  i  )  throw (Error) [virtual]

Destructor.

Operator for retrieving columns.

Parameters:
i Number of column (starting from 0).
See also:
MySQLStatement::getNumCols

Implements ResultRow.

Definition at line 24 of file mysqlResultRow.cpp.

References ERRORMACRO.

00025 {
00026   ERRORMACRO( result != NULL, Error, ,
00027               "Handle of SQL-data was invalidated. Probably "
00028               "MySQLStatement::~MySQLStatement called before finishing "
00029               "reading out the results." );
00030 
00031   return result[ i ] != NULL ? result[ i ] : "";
00032 }


Field Documentation

MYSQL_ROW MySQLResultRow::result [protected]

Definition at line 45 of file mysqlResultRow.hpp.

Referenced by invalidate(), and MySQLResultRow().


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


anymeal 0.31 - recipe management software - Make the most of your food! - © Jan Wedekind Sun Dec 19 19:36:04 2010 - GNU Free Documentation License