19 #ifndef PQXX_H_TABLEWRITER
20 #define PQXX_H_TABLEWRITER
22 #include "pqxx/compiler-public.hxx"
23 #include "pqxx/compiler-internal-pre.hxx"
25 #include "pqxx/tablestream"
51 const PGSTD::string &WName,
52 const PGSTD::string &Null=PGSTD::string());
62 const PGSTD::string &WName,
80 const PGSTD::string &WName,
83 const PGSTD::string &Null);
87 template<typename IT>
void insert(IT Begin, IT End);
88 template<typename TUPLE>
void insert(const TUPLE &);
89 template<typename IT>
void push_back(IT Begin, IT End);
90 template<typename TUPLE>
void push_back(const TUPLE &);
102 template<
typename IT> PGSTD::string generate(IT Begin, IT End)
const;
103 template<
typename TUPLE> PGSTD::string generate(
const TUPLE &)
const;
113 virtual void complete();
116 void write_raw_line(
const PGSTD::string &);
120 const PGSTD::string &WName,
121 const PGSTD::string &Columns = PGSTD::string());
123 void PQXX_PRIVATE writer_close();
137 class back_insert_iterator<pqxx::tablewriter> :
138 public iterator<output_iterator_tag, void,void,void,void>
144 back_insert_iterator &
145 operator=(
const back_insert_iterator &rhs)
throw ()
147 m_Writer = rhs.m_Writer;
151 template<
typename TUPLE>
152 back_insert_iterator &operator=(
const TUPLE &T)
173 const PGSTD::string &WName,
176 namedclass(
"tablewriter", WName),
179 setup(T, WName,
columnlist(begincolumns, endcolumns));
183 const PGSTD::string &WName,
186 const PGSTD::string &Null) :
187 namedclass(
"tablewriter", WName),
190 setup(T, WName,
columnlist(begincolumns, endcolumns));
196 PGSTD::string PQXX_LIBEXPORT
Escape(
const PGSTD::string &s,
197 const PGSTD::string &null);
199 template<
typename STR>
inline PGSTD::string
EscapeAny(
const PGSTD::string &s,
200 const PGSTD::string &null) {
return Escape(s,null); }
201 template<
typename STR>
inline PGSTD::string
EscapeAny(
const char s[],
202 const PGSTD::string &null) {
return s ?
Escape(PGSTD::string(s),null):
"\\N";}
203 template<
typename T>
inline PGSTD::string
EscapeAny(
const T &t,
208 const PGSTD::string &m_null;
210 explicit Escaper(
const PGSTD::string &null) : m_null(null) {}
216 template<
typename IT>
223 template<
typename TUPLE>
226 return generate(T.begin(), T.end());
238 insert(T.begin(), T.end());
241 template<
typename IT>
247 template<
typename TUPLE>
250 insert(T.begin(), T.end());
253 template<
typename TUPLE>
263 #include "pqxx/compiler-internal-post.hxx"