28 #if !defined(MYSQLPP_SQL_BUFFER_H) 29 #define MYSQLPP_SQL_BUFFER_H 63 replace_buffer(s.data(), static_cast<size_type>(s.length()));
80 const char*
data()
const {
return data_; }
140 #endif // !defined(MYSQLPP_SQL_BUFFER_H) bool is_string()
Returns true if type of buffer's contents is string.
Definition: sql_buffer.h:95
bool is_null() const
Return true if buffer's contents represent a SQL null.
Definition: sql_buffer.h:103
Declares the RefCountedPointer template.
Holds SQL data in string form plus type information for use in converting the string to compatible C+...
Definition: sql_buffer.h:41
SQL field type information.
Definition: type_info.h:148
static const enum_field_types string_type
The internal constant we use for our string type.
Definition: type_info.h:270
SQLBuffer & assign(const char *data, size_type length, mysql_type_info type=mysql_type_info::string_type, bool is_null=false)
Replace contents of buffer with copy of given C string.
Definition: sql_buffer.cpp:37
SQLBuffer(const std::string &s, mysql_type_info type, bool is_null)
Initialize object as a copy of a C++ string object.
Definition: sql_buffer.h:60
const char * data() const
Return pointer to raw data buffer.
Definition: sql_buffer.h:80
Declares classes that provide an interface between the SQL and C++ type systems.
bool escape_q() const
Returns true if the SQL type is of a type that needs to be escaped.
Definition: type_info.cpp:283
size_t size_type
Type of length values.
Definition: sql_buffer.h:45
const mysql_type_info & type() const
Return the SQL type of the data held in the buffer.
Definition: sql_buffer.h:113
~SQLBuffer()
Destructor.
Definition: sql_buffer.h:67
bool quote_q() const
Returns true if we were initialized with a data type that must be quoted when used in a SQL query.
Definition: sql_buffer.cpp:56
SQLBuffer(const char *data, size_type length, mysql_type_info type, bool is_null)
Initialize object as a copy of a raw data buffer.
Definition: sql_buffer.h:54
size_type length() const
Return number of bytes in data buffer.
Definition: sql_buffer.h:92
bool escape_q() const
Returns true if we were initialized with a data type that must be escaped when used in a SQL query.
Definition: sql_buffer.h:84
void set_null()
Sets the internal SQL null flag.
Definition: sql_buffer.h:110