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.

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


Member Function Documentation

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, and result.

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 }

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; }


Field Documentation

MYSQL_ROW MySQLResultRow::result [protected]

Definition at line 45 of file mysqlResultRow.hpp.

Referenced by invalidate(), MySQLResultRow(), and operator[]().


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

anymeal 0.30 - recipe management software - Make the most of your food! - © Jan Wedekind Sun Sep 14 16:01:29 2008 - GNU Free Documentation License