libpqxx  7.9.0
pqxx::basic_fieldstream< CHAR, TRAITS > Class Template Reference

Input stream that gets its data from a result field. More...

#include <field.hxx>

Inheritance diagram for pqxx::basic_fieldstream< CHAR, TRAITS >:

Public Types

using char_type = CHAR
 
using traits_type = TRAITS
 
using int_type = typename traits_type::int_type
 
using pos_type = typename traits_type::pos_type
 
using off_type = typename traits_type::off_type
 

Public Member Functions

 basic_fieldstream (field const &f)
 

Detailed Description

template<typename CHAR = char, typename TRAITS = std::char_traits<CHAR>>
class pqxx::basic_fieldstream< CHAR, TRAITS >

Input stream that gets its data from a result field.

Deprecated:
To convert a field's value string to some other type, e.g. to an int, use the field's as<...>() member function. To read a field efficiently just as a string, use its c_str() or its as<std::string_vview>().

Works like any other istream to read data from a field. It supports all formatting and streaming operations of std::istream. For convenience there is a fieldstream alias, which defines a basic_fieldstream for char. This is similar to how e.g. std::ifstream relates to std::basic_ifstream.

This class has only been tested for the char type (and its default traits).

Member Typedef Documentation

◆ char_type

template<typename CHAR = char, typename TRAITS = std::char_traits<CHAR>>
using pqxx::basic_fieldstream< CHAR, TRAITS >::char_type = CHAR

◆ int_type

template<typename CHAR = char, typename TRAITS = std::char_traits<CHAR>>
using pqxx::basic_fieldstream< CHAR, TRAITS >::int_type = typename traits_type::int_type

◆ off_type

template<typename CHAR = char, typename TRAITS = std::char_traits<CHAR>>
using pqxx::basic_fieldstream< CHAR, TRAITS >::off_type = typename traits_type::off_type

◆ pos_type

template<typename CHAR = char, typename TRAITS = std::char_traits<CHAR>>
using pqxx::basic_fieldstream< CHAR, TRAITS >::pos_type = typename traits_type::pos_type

◆ traits_type

template<typename CHAR = char, typename TRAITS = std::char_traits<CHAR>>
using pqxx::basic_fieldstream< CHAR, TRAITS >::traits_type = TRAITS

Constructor & Destructor Documentation

◆ basic_fieldstream()

template<typename CHAR = char, typename TRAITS = std::char_traits<CHAR>>
pqxx::basic_fieldstream< CHAR, TRAITS >::basic_fieldstream ( field const &  f)

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