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

mysqlpp::ResUse Class Reference

A basic result set class, for use with "use" queries. More...

#include <result.h>

Inheritance diagram for mysqlpp::ResUse:

Inheritance graph
[legend]
Collaboration diagram for mysqlpp::ResUse:

Collaboration graph
[legend]
List of all members.

Public Methods

Row fetch_row ()
 Wraps mysql_fetch_row() in MySQL C API.

bool eof () const
 Wraps mysql_eof() in MySQL C API.

unsigned long * fetch_lengths () const
 Wraps mysql_fetch_lengths() in MySQL C API.

Field & fetch_field () const
 Wraps mysql_fetch_field() in MySQL C API.

void field_seek (int field)
 Wraps mysql_field_seek() in MySQL C API.

int num_fields () const
 Wraps mysql_num_fields() in MySQL C API.

std::string & table ()
 Get the name of table that the result set comes from.

int field_num (const std::string &) const
 Get the index of the named field.

std::string & field_name (int)
 Get the name of the field at the given index.

FieldNamesfield_names ()
 Get the names of the fields within this result set.

void reset_field_names ()
 Reset the names in the field list to their original values.

mysql_type_infofield_type (int i)
 Get the MySQL type for a field given its index.

FieldTypesfield_types ()
 Get a list of the types of the fields within this result set.

void reset_field_types ()
 Reset the field types to their original values.

int names (const std::string &s) const
 Alias for field_num().

std::string & names (int i)
 Alias for field_name().

FieldNamesnames ()
 Alias for field_names().

void reset_names ()
 Alias for reset_field_names().

mysql_type_infotypes (int i)
 Alias for field_type().

FieldTypestypes ()
 Alias for field_types().

void reset_types ()
 Alias for reset_field_types().

const Fieldsfields () const
 Get the underlying Fields structure.

const Field & fields (unsigned int i) const
 Get the underlying Field structure given its index.


Protected Methods

void copy (const ResUse &other)
 copy another ResUse object's contents into this one.


Detailed Description

A basic result set class, for use with "use" queries.

A "use" query is one where you make the query and then process just one row at a time in the result instead of dealing with them all as a single large chunk. (The name comes from the MySQL C API function that initiates this action, mysql_use_result().) By calling fetch_row() until it throws a mysqlpp::BadQuery exception (or an empty row if exceptions are disabled), you can process the result set one row at a time.


Member Function Documentation

void mysqlpp::ResUse::copy const ResUse &    other [protected]
 

copy another ResUse object's contents into this one.

Not to be used on the self. Self-copy is not allowed.

Row mysqlpp::ResUse::fetch_row   [inline]
 

Wraps mysql_fetch_row() in MySQL C API.

This is not a thin wrapper. It does a lot of error checking before returning the mysqlpp::Row object containing the row data.

std::string & mysqlpp::ResUse::field_name int    [inline]
 

Get the name of the field at the given index.

This is the inverse of field_num().

int mysqlpp::ResUse::field_num const std::string &    const [inline]
 

Get the index of the named field.

This is the inverse of field_name().


The documentation for this class was generated from the following files:
Generated on Thu May 5 05:31:32 2005 for MySQL++ by doxygen1.2.18