Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

pqxx::Result::Field Class Reference

Reference to a field in a result set. More...

#include <result.h>

Inheritance diagram for pqxx::Result::Field:

pqxx::Result::Tuple List of all members.

Public Types

typedef size_t size_type

Public Member Functions

 Field (const Tuple &R, Tuple::size_type C)
 Constructor.

const char * c_str () const
 Read as plain C string.

const char * Name () const
 Column name.

template<typename T> bool to (T &Obj) const
 Read value into Obj; or leave Obj untouched & return false if null.

template<typename T> bool to (T &Obj, const T &Default) const
 Read value into Obj; or use Default & return false if null.

bool is_null () const
int size () const

Detailed Description

Reference to a field in a result set.

A Field represents one entry in a Tuple. It represents an actual value in the result set, and can be converted to various types.


Member Typedef Documentation

typedef size_t pqxx::Result::Field::size_type
 

Reimplemented from pqxx::Result::Tuple.


Constructor & Destructor Documentation

pqxx::Result::Field::Field const Tuple   R,
Tuple::size_type    C
 

Constructor.

Create Field as reference to a field in a result set.

Parameters:
R Tuple that this Field is part of.
C column number of this field.


Member Function Documentation

const char* pqxx::Result::Field::c_str   const
 

Read as plain C string.

Since the field's data is stored internally in the form of a zero-terminated C string, this is the fastest way to read it. Use the to() functions to convert the string to other types such as int, or to C++ strings.

bool pqxx::Result::Field::is_null   const
 

const char * pqxx::Result::Field::Name   const
 

Column name.

int pqxx::Result::Field::size   const
 

Reimplemented from pqxx::Result::Tuple.

template<typename T>
bool pqxx::Result::Field::to T &    Obj,
const T &    Default
const
 

Read value into Obj; or use Default & return false if null.

template<typename T>
bool pqxx::Result::Field::to T &    Obj const
 

Read value into Obj; or leave Obj untouched & return false if null.


The documentation for this class was generated from the following file:
Generated on Fri Feb 28 19:23:33 2003 for libpqxx by doxygen1.3-rc3