19 #ifndef PQXX_H_TABLEREADER
20 #define PQXX_H_TABLEREADER
21 #include "pqxx/compiler-public.hxx"
22 #include "pqxx/compiler-internal-pre.hxx"
23 #include "pqxx/result"
24 #include "pqxx/tablestream"
35 const std::string &Name,
36 const std::string &Null=std::string());
37 template<
typename ITER>
39 const std::string &Name,
43 const std::string &Name,
46 const std::string &Null);
48 template<
typename TUPLE>
tablereader &operator>>(TUPLE &);
49 operator bool() const PQXX_NOEXCEPT {
return !m_Done; }
50 bool operator!() const PQXX_NOEXCEPT {
return m_Done; }
51 bool get_raw_line(std::string &Line);
52 template<
typename TUPLE>
53 void tokenize(std::string, TUPLE &)
const;
54 virtual void complete() PQXX_OVERRIDE;
57 const std::
string &RName,
58 const std::
string &Columns=std::
string());
59 PQXX_PRIVATE
void reader_close();
60 std::
string extract_field(
62 std::
string::size_type &) const;
65 template<typename ITER> inline
67 const std::
string &Name,
74 setup(T, Name, columnlist(begincolumns, endcolumns));
76 template<
typename ITER>
inline
78 const std::string &Name,
81 const std::string &Null) :
82 namedclass(Name,
"tablereader"),
86 setup(T, Name,
columnlist(begincolumns, endcolumns));
88 template<
typename TUPLE>
91 std::back_insert_iterator<TUPLE> ins = std::back_inserter(T);
92 std::string::size_type here=0;
93 while (here < Line.size()) *ins++ = extract_field(Line, here);
95 template<
typename TUPLE>
99 if (get_raw_line(Line)) tokenize(Line, T);
103 #include "pqxx/compiler-internal-post.hxx"
tablereader & operator>>(TUPLE &)
Definition: tablereader.hxx:96
Definition: tablereader.hxx:31
tablereader(transaction_base &, const std::string &Name, const std::string &Null=std::string())
Definition: tablereader.cxx:28
bool operator!() const PQXX_NOEXCEPT
Definition: tablereader.hxx:50
static std::string columnlist(ITER colbegin, ITER colend)
Definition: tablestream.hxx:50
void tokenize(std::string, TUPLE &) const
Definition: tablereader.hxx:89
Definition: tablestream.hxx:28
Definition: transaction_base.hxx:133