00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #if !defined(MYSQLPP_SQLSTREAM_H)
00028 #define MYSQLPP_SQLSTREAM_H
00029
00030 #include "common.h"
00031
00032 #include <sstream>
00033
00034 namespace mysqlpp {
00035
00036 #if !defined(DOXYGEN_IGNORE)
00037
00038 class MYSQLPP_EXPORT Connection;
00039 #endif
00040
00044
00045 class MYSQLPP_EXPORT SQLStream :
00046 public std::ostringstream
00047 {
00048 public:
00053 SQLStream(Connection* c, const char* pstr = 0);
00054
00058 SQLStream(const SQLStream& s);
00059
00074 size_t escape_string(std::string* ps, const char* original = 0,
00075 size_t length = 0) const;
00076
00098 size_t escape_string(char* escaped, const char* original,
00099 size_t length) const;
00100
00102 SQLStream& operator=(const SQLStream& rhs);
00103
00105 Connection* conn_;
00106 };
00107
00108
00112 inline std::ostream& operator <<(std::ostream& os, SQLStream& s)
00113 {
00114 return os << s.str();
00115 }
00116
00117
00118 }
00119
00120 #endif // !defined(MYSQLPP_SQLSTREAM_H)
00121