Go to the documentation of this file.
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_; }
103 bool is_null()
const {
return is_null_; }
110 void set_null() { is_null_ =
true; }
140 #endif // !defined(MYSQLPP_SQL_BUFFER_H)
const mysql_type_info & type() const
Return the SQL type of the data held in the buffer.
Definition: sql_buffer.h:157
const char * data() const
Return pointer to raw data buffer.
Definition: sql_buffer.h:124
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:98
size_type length() const
Return number of bytes in data buffer.
Definition: sql_buffer.h:136
void set_null()
Sets the internal SQL null flag.
Definition: sql_buffer.h:154
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:60
Declares the RefCountedPointer template.
const std::type_info & c_type() const
Returns the type_info for the C++ type associated with the SQL type.
Definition: type_info.h:265
Holds SQL data in string form plus type information for use in converting the string to compatible C+...
Definition: sql_buffer.h:63
~SQLBuffer()
Destructor.
Definition: sql_buffer.h:111
Declares the closest C++ equivalent of each MySQL column type.
bool escape_q() const
Returns true if the SQL type is of a type that needs to be escaped.
Definition: type_info.cpp:283
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:79
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:128
size_t size_type
Type of length values.
Definition: sql_buffer.h:89
bool quote_q() const
Returns true if the SQL type is of a type that needs to be quoted.
Definition: type_info.cpp:268
Declares classes that provide an interface between the SQL and C++ type systems.
bool is_null() const
Return true if buffer's contents represent a SQL null.
Definition: sql_buffer.h:147
SQL field type information.
Definition: type_info.h:170
static const enum_field_types string_type
The internal constant we use for our string type.
Definition: type_info.h:314
bool is_string()
Returns true if type of buffer's contents is string.
Definition: sql_buffer.h:139
Declares the SQLBuffer class.
const mysql_type_info base_type() const
Returns the type_info for the C++ type inside of the mysqlpp::Null type.
Definition: type_info.h:272
Declares classes to add SQL-compatible date and time types to C++'s type system.