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

result.h File Reference

#include <stdexcept>
#include "pqxx/util.h"

Go to the source code of this file.

Namespaces

namespace  pqxx

Functions

template<typename STREAM> STREAM & operator<< (STREAM &S, const pqxx::Result::Field &F)
 Write a result field to any type of stream.


Function Documentation

template<typename STREAM>
STREAM& operator<< STREAM &    S,
const pqxx::Result::Field   F
 

Write a result field to any type of stream.

This can be convenient when writing a Field to an output stream. More importantly, it lets you write a Field to e.g. a stringstream which you can then use to read, format and convert the field in ways that to() does not support.

Example: parse a Field into a variable of the nonstandard "long long" type.

extern Result R; long long L; stringstream S;

// Write field's string into S S << R[0][0];

// Parse contents of S into L S >> L;


Generated on Fri Feb 28 19:23:32 2003 for libpqxx by doxygen1.3-rc3