tablestream.hxx
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PQXX_H_TABLESTREAM
00020 #define PQXX_H_TABLESTREAM
00021 #include "pqxx/compiler-public.hxx"
00022 #include "pqxx/compiler-internal-pre.hxx"
00023 #include "pqxx/transaction_base"
00024 namespace pqxx
00025 {
00026 class transaction_base;
00028 class PQXX_LIBEXPORT PQXX_NOVTABLE tablestream :
00029 public internal::transactionfocus
00030 {
00031 public:
00032 explicit tablestream(transaction_base &Trans,
00033 const std::string &Null=std::string());
00034 virtual ~tablestream() PQXX_NOEXCEPT =0;
00035 virtual void complete() =0;
00036 protected:
00037 const std::string &NullStr() const { return m_Null; }
00038 bool is_finished() const PQXX_NOEXCEPT { return m_Finished; }
00039 void base_close();
00040 template<typename ITER>
00041 static std::string columnlist(ITER colbegin, ITER colend);
00042 private:
00043 std::string m_Null;
00044 bool m_Finished;
00045 tablestream();
00046 tablestream(const tablestream &);
00047 tablestream &operator=(const tablestream &);
00048 };
00049 template<typename ITER> inline
00050 std::string tablestream::columnlist(ITER colbegin, ITER colend)
00051 {
00052 return separated_list(",", colbegin, colend);
00053 }
00054 }
00055 #include "pqxx/compiler-internal-post.hxx"
00056 #endif