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;
70 template<
typename ITER>
inline
73 const std::string &Name,
76 namedclass{Name,
"tablereader"},
80 set_up(T, Name, columnlist(begincolumns, endcolumns));
84 template<
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));
99 template<
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);
108 template<
typename TUPLE>
112 if (get_raw_line(Line)) tokenize(Line, T);
117 #include "pqxx/compiler-internal-post.hxx"
bool get_raw_line(std::string &Line)
Definition: tablereader.cxx:55
void tokenize(std::string, TUPLE &) const
Definition: tablereader.hxx:100
Private namespace for libpqxx's internal use; do not access.
Definition: connection_base.hxx:43
tablereader(transaction_base &, const std::string &Name, const std::string &Null=std::string{})
Definition: tablereader.cxx:21
Base class for obsolete tablereader/tablewriter classes.
Definition: tablestream.hxx:26
virtual void complete() override
Definition: tablereader.cxx:70
tablereader & operator>>(TUPLE &)
Definition: tablereader.hxx:109
Helper base class: object descriptions for error messages and such.
Definition: util.hxx:233
~tablereader() noexcept
Definition: tablereader.cxx:42
bool operator!() const noexcept
Definition: tablereader.hxx:52
constexpr int digit_to_number(char c) noexcept
Compute numeric value of given textual digit (assuming that it is a digit)
Definition: strconv.hxx:323
Definition: tablereader.hxx:29
Interface definition (and common code) for "transaction" classes.
Definition: transaction_base.hxx:136
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:25