#include <sqlstream.h>
Collaboration diagram for mysqlpp::SQLStream:
Public Member Functions | |
SQLStream (Connection *c, const char *pstr=0) | |
Create a new stream object attached to a connection. | |
SQLStream (const SQLStream &s) | |
Create a new stream object as a copy of another. | |
size_t | escape_string (std::string *ps, const char *original=0, size_t length=0) const |
Return a SQL-escaped version of a character buffer. | |
size_t | escape_string (char *escaped, const char *original, size_t length) const |
Return a SQL-escaped version of the given character buffer. | |
SQLStream & | operator= (const SQLStream &rhs) |
Assigns contents of another SQLStream to this one. | |
Public Attributes | |
Connection * | conn_ |
Connection to send queries through. |
See the user manual for more details about these options.
mysqlpp::SQLStream::SQLStream | ( | Connection * | c, | |
const char * | pstr = 0 | |||
) |
Create a new stream object attached to a connection.
c | connection used for escaping text | |
pstr | an optional initial string |
mysqlpp::SQLStream::SQLStream | ( | const SQLStream & | s | ) |
Create a new stream object as a copy of another.
This is a traditional copy ctor.
size_t mysqlpp::SQLStream::escape_string | ( | char * | escaped, | |
const char * | original, | |||
size_t | length | |||
) | const |
Return a SQL-escaped version of the given character buffer.
escaped | character buffer to hold escaped version; must point to at least (length * 2 + 1) bytes | |
original | pointer to the character buffer to escape | |
length | number of characters to escape |
number | of characters placed in escaped |
size_t mysqlpp::SQLStream::escape_string | ( | std::string * | ps, | |
const char * | original = 0 , |
|||
size_t | length = 0 | |||
) | const |
Return a SQL-escaped version of a character buffer.
ps | pointer to C++ string to hold escaped version; if original is 0, also holds the original data to be escaped | |
original | if given, pointer to the character buffer to escape instead of contents of *ps | |
length | if both this and original are given, number of characters to escape instead of ps->length() |
number | of characters placed in *ps |