#include <row.h>
Inheritance diagram for mysqlpp::Row:
Public Member Functions | |
Row () | |
Default constructor. | |
Row (const MYSQL_ROW &d, const ResUse *r, unsigned long *jj, bool te=true) | |
Create a row object. | |
~Row () | |
Destroy object. | |
const ResUse & | parent () const |
Get a reference to our parent class. | |
size_type | size () const |
Get the number of fields in the row. | |
const ColData | operator[] (const char *field) const |
Get the value of a field given its name. | |
const ColData | operator[] (size_type i) const |
Get the value of a field given its index. | |
const ColData | at (size_type i) const |
Get the value of a field given its index. | |
const char * | raw_data (int i) const |
Return the value of a field as a C string given its index, in raw form. | |
std::string::size_type | raw_size (int i) const |
Return the size of a field's raw data given its index. | |
const std::string & | raw_string (int i) const |
Return the value of a field as a C++ string given its index, in raw form. | |
operator bool () const | |
Returns true if there is data in the row. | |
template<class Manip> value_list_ba< Row, Manip > | value_list (const char *d=",", Manip m=quote) const |
Get a list of the values in this row. | |
template<class Manip> value_list_b< Row, Manip > | value_list (const char *d, const std::vector< bool > &vb, Manip m=quote) const |
Get a list of the values in this row. | |
value_list_b< Row, quote_type0 > | value_list (const std::vector< bool > &vb) const |
Get a list of the values in this row. | |
template<class Manip> value_list_b< Row, Manip > | value_list (const char *d, Manip m, bool t0, bool t1=false, bool t2=false, bool t3=false, bool t4=false, bool t5=false, bool t6=false, bool t7=false, bool t8=false, bool t9=false, bool ta=false, bool tb=false, bool tc=false) const |
Get a list of the values in this row. | |
value_list_b< Row, quote_type0 > | value_list (const char *d, bool t0, bool t1=false, bool t2=false, bool t3=false, bool t4=false, bool t5=false, bool t6=false, bool t7=false, bool t8=false, bool t9=false, bool ta=false, bool tb=false, bool tc=false) const |
Get a list of the values in this row. | |
value_list_b< Row, quote_type0 > | value_list (bool t0, bool t1=false, bool t2=false, bool t3=false, bool t4=false, bool t5=false, bool t6=false, bool t7=false, bool t8=false, bool t9=false, bool ta=false, bool tb=false, bool tc=false) const |
Get a list of the values in this row. | |
template<class Manip> value_list_b< Row, Manip > | value_list (const char *d, Manip m, std::string s0, std::string s1="", std::string s2="", std::string s3="", std::string s4="", std::string s5="", std::string s6="", std::string s7="", std::string s8="", std::string s9="", std::string sa="", std::string sb="", std::string sc="") const |
Get a list of the values in this row. | |
value_list_b< Row, quote_type0 > | value_list (const char *d, std::string s0, std::string s1="", std::string s2="", std::string s3="", std::string s4="", std::string s5="", std::string s6="", std::string s7="", std::string s8="", std::string s9="", std::string sa="", std::string sb="", std::string sc="") const |
Get a list of the values in this row. | |
value_list_b< Row, quote_type0 > | value_list (std::string s0, std::string s1="", std::string s2="", std::string s3="", std::string s4="", std::string s5="", std::string s6="", std::string s7="", std::string s8="", std::string s9="", std::string sa="", std::string sb="", std::string sc="") const |
Get a list of the values in this row. | |
value_list_ba< FieldNames, do_nothing_type0 > | field_list (const char *d=",") const |
Get a list of the field names in this row. | |
template<class Manip> value_list_ba< FieldNames, Manip > | field_list (const char *d, Manip m) const |
Get a list of the field names in this row. | |
template<class Manip> value_list_b< FieldNames, Manip > | field_list (const char *d, Manip m, const std::vector< bool > &vb) const |
Get a list of the field names in this row. | |
value_list_b< FieldNames, quote_type0 > | field_list (const char *d, const std::vector< bool > &vb) const |
Get a list of the field names in this row. | |
value_list_b< FieldNames, quote_type0 > | field_list (const std::vector< bool > &vb) const |
Get a list of the field names in this row. | |
template<class Manip> value_list_b< FieldNames, Manip > | field_list (const char *d, Manip m, bool t0, bool t1=false, bool t2=false, bool t3=false, bool t4=false, bool t5=false, bool t6=false, bool t7=false, bool t8=false, bool t9=false, bool ta=false, bool tb=false, bool tc=false) const |
Get a list of the field names in this row. | |
value_list_b< FieldNames, quote_type0 > | field_list (const char *d, bool t0, bool t1=false, bool t2=false, bool t3=false, bool t4=false, bool t5=false, bool t6=false, bool t7=false, bool t8=false, bool t9=false, bool ta=false, bool tb=false, bool tc=false) const |
Get a list of the field names in this row. | |
value_list_b< FieldNames, quote_type0 > | field_list (bool t0, bool t1=false, bool t2=false, bool t3=false, bool t4=false, bool t5=false, bool t6=false, bool t7=false, bool t8=false, bool t9=false, bool ta=false, bool tb=false, bool tc=false) const |
Get a list of the field names in this row. | |
equal_list_ba< FieldNames, Row, quote_type0 > | equal_list (const char *d=",", const char *e="=") const |
Get an "equal list" of the fields and values in this row. | |
template<class Manip> equal_list_ba< FieldNames, Row, Manip > | equal_list (const char *d, const char *e, Manip m) const |
Get an "equal list" of the fields and values in this row. |
|
Create a row object.
|
|
Get the value of a field given its index. If the index value is bad, the underlying std::vector is supposed to throw an exception, according to the Standard. For this function to work, the Result or ResUse object that created this object must still exist. In other words, you cannot re-use or destroy the result object until you are done retrieving data from this row object. See operator[](const char*) for more caveats. |
|
Get an "equal list" of the fields and values in this row. This method's parameters govern how the returned list will behave when you insert it into a C++ stream:
'a' = 'c', 'b' = 'd''e' Notice how the single quote was 'escaped' in the SQL way to avoid a syntax error. |
|
Get an "equal list" of the fields and values in this row. When inserted into a C++ stream, the delimiter 'd' will be used between the items, " = " is the relationship operator, and items will be quoted and escaped. |
|
Get a list of the field names in this row. For each true parameter, the field name in that position within the row is added to the returned list. When the list is inserted into a C++ stream, a comma will be placed between the items as a delimiter, and the items will be quoted and escaped. |
|
Get a list of the field names in this row. For each true parameter, the field name in that position within the row is added to the returned list. When the list is inserted into a C++ stream, the delimiter 'd' will be placed between the items as a delimiter, and the items will be quoted and escaped. |
|
Get a list of the field names in this row. For each true parameter, the field name in that position within the row is added to the returned list. When the list is inserted into a C++ stream, the delimiter 'd' will be placed between the items as a delimiter, and the manipulator 'm' used before each item. |
|
Get a list of the field names in this row.
|
|
Get a list of the field names in this row.
|
|
Get a list of the field names in this row.
|
|
Get a list of the field names in this row.
|
|
Get a list of the field names in this row. When inserted into a C++ stream, the delimiter 'd' will be used between the items, and no manipulator will be used on the items. |
|
Get the value of a field given its index.
This function is just syntactic sugar, wrapping the at() method. The at() method is the only way to get at the first field in a result set by index, as
|
|
Get the value of a field given its name. If the field does not exist in this row, we throw a BadFieldName exception. For this operator to work, the Result or ResUse object that created this object must still exist. In other words, you cannot re-use or destroy the result object until you are done retrieving data from this row object. Note that we return the ColData object by value. The purpose of ColData is to make it easy to convert the string data returned by the MySQL server to some more appropriate type, so you're almost certain to use this operator in a construct like this:
string s = row["myfield"];
That accesses myfield within the row, returns a temporary ColData object, which is then automatically converted to a
const char* pc = row["myfield"];
This one line of code does what you expect, but This function is rather inefficient. If that is a concern for you, use at(), operator[](size_type) or the SSQLS mechanism' instead. |
|
Return the value of a field as a C string given its index, in raw form. This is the same thing as operator[], except that the data isn't converted to a ColData object first. Also, this method does not check for out-of-bounds array indices. |
|
Return the value of a field as a C++ string given its index, in raw form. This is the same thing as operator[], except that the data isn't converted to a ColData object first. |
|
Get a list of the values in this row. The 's' parameters name the fields that will be added to the returned list. When inserted into a C++ stream, a comma will be placed between the items as a delimiter, and items will be quoted and escaped. |
|
Get a list of the values in this row. The 's' parameters name the fields that will be added to the returned list. When inserted into a C++ stream, the delimiter 'd' will be placed between the items, and items will be quoted and escaped. |
|
Get a list of the values in this row. The 's' parameters name the fields that will be added to the returned list. When inserted into a C++ stream, the delimiter 'd' will be placed between the items, and the manipulator 'm' will be inserted before each item. |
|
Get a list of the values in this row. For each true parameter, the value in that position within the row is added to the returned list. When the list is inserted into a C++ stream, the a comma will be placed between the items, as a delimiter, and items will be quoted and escaped. |
|
Get a list of the values in this row. For each true parameter, the value in that position within the row is added to the returned list. When the list is inserted into a C++ stream, the delimiter 'd' will be placed between the items, and items will be quoted and escaped. |
|
Get a list of the values in this row. For each true parameter, the value in that position within the row is added to the returned list. When the list is inserted into a C++ stream, the delimiter 'd' will be placed between the items, and the manipulator 'm' used before each item. |
|
Get a list of the values in this row.
|
|
Get a list of the values in this row.
|
|
Get a list of the values in this row. When inserted into a C++ stream, the delimiter 'd' will be used between the items, and the quoting and escaping rules will be set by the manipulator 'm' you choose.
|