13#ifndef PQXX_H_TABLEREADER
14#define PQXX_H_TABLEREADER
16#include "pqxx/compiler-public.hxx"
17#include "pqxx/compiler-internal-pre.hxx"
18#include "pqxx/result.hxx"
19#include "pqxx/tablestream.hxx"
34 const std::string &Name,
35 const std::string &Null=std::string{});
36 template<
typename ITER>
39 const std::string &Name,
42 template<
typename ITER>
45 const std::string &Name,
48 const std::string &Null);
50 template<
typename TUPLE>
tablereader &operator>>(TUPLE &);
51 operator bool() const noexcept {
return not m_done; }
53 bool get_raw_line(std::string &Line);
54 template<
typename TUPLE>
55 void tokenize(std::string, TUPLE &)
const;
56 virtual void complete()
override;
60 const std::string &RName,
61 const std::string &Columns=std::string{});
62 PQXX_PRIVATE
void reader_close();
63 std::string extract_field(
65 std::string::size_type &)
const;
70template<
typename ITER>
inline
73 const std::string &Name,
76 namedclass{Name,
"tablereader"},
80 set_up(T, Name,
columnlist(begincolumns, endcolumns));
84template<
typename ITER>
inline
87 const std::string &Name,
90 const std::string &Null) :
91 namedclass{Name,
"tablereader"},
95 set_up(T, Name,
columnlist(begincolumns, endcolumns));
99template<
typename TUPLE>
102 std::back_insert_iterator<TUPLE> ins = std::back_inserter(T);
103 std::string::size_type here = 0;
104 while (here < Line.size()) *ins++ = extract_field(Line, here);
108template<
typename TUPLE>
112 if (get_raw_line(Line)) tokenize(Line, T);
117#include "pqxx/compiler-internal-post.hxx"
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:26
Definition: tablereader.hxx:30
void tokenize(std::string, TUPLE &) const
Definition: tablereader.hxx:100
tablereader(transaction_base &, const std::string &Name, const std::string &Null=std::string{})
Definition: tablereader.cxx:21
bool operator!() const noexcept
Definition: tablereader.hxx:52
tablereader & operator>>(TUPLE &)
Definition: tablereader.hxx:109
Base class for obsolete tablereader/tablewriter classes.
Definition: tablestream.hxx:28
static std::string columnlist(ITER colbegin, ITER colend)
Definition: tablestream.hxx:52
Interface definition (and common code) for "transaction" classes.
Definition: transaction_base.hxx:138