libcommonc++
0.7
|
A value binder for a SQLQuery object. More...
#include <SQLValueBinder.h++>
Public Member Functions | |
SQLValueBinder (SQLQuery &query) | |
Construct a new SQLValueBinder for the given SQLQuery. More... | |
~SQLValueBinder () | |
Destructor. More... | |
SQLValueBinder & | operator<< (bool value) |
Bind a boolean value to the next query parameter. More... | |
SQLValueBinder & | operator<< (int value) |
Bind an integer value to the next query parameter. More... | |
SQLValueBinder & | operator<< (const int64_t &value) |
Bind a 64-bit integer value to the next query parameter. More... | |
SQLValueBinder & | operator<< (const double &value) |
Bind a double-precision floating point value to the next query parameter. More... | |
SQLValueBinder & | operator<< (const String &value) |
Bind a String value to the next query parameter. More... | |
SQLValueBinder & | operator<< (const char *value) |
Bind a string value to the next query parameter. More... | |
SQLValueBinder & | operator<< (const Blob &value) |
Bind a Blob value to the next query parameter. More... | |
SQLValueBinder & | operator>> (bool &value) |
Extract a boolean value from the next field in the results. More... | |
SQLValueBinder & | operator>> (int &value) |
Extract an integer value from the next field in the results. More... | |
SQLValueBinder & | operator>> (int64_t &value) |
Extract a 64-bit integer value from the next field in the results. More... | |
SQLValueBinder & | operator>> (double &value) |
Extract a double-precision floating point value from the next field in the results. More... | |
SQLValueBinder & | operator>> (String &value) |
Extract a String value from the next field in the results. More... | |
SQLValueBinder & | operator>> (Blob &value) |
Extract a Blob value from the next field in the results. More... | |
void | reset () |
Reset the SQLValueBinder. More... | |
A value binder for a SQLQuery object.
This class provides for convenient binding of values to consecutive query parameters through the chaining of the left-shift operator, and extraction of values in consecutive fields of query results through the chaining of the right-shift operator.
SQLValueBinder | ( | SQLQuery & | query | ) |
Construct a new SQLValueBinder for the given SQLQuery.
~SQLValueBinder | ( | ) |
Destructor.
SQLValueBinder & operator<< | ( | bool | value | ) |
Bind a boolean value to the next query parameter.
value | The value to bind. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all parameters have already been bound. |
SQLValueBinder & operator<< | ( | int | value | ) |
Bind an integer value to the next query parameter.
value | The value to bind. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all parameters have already been bound. |
SQLValueBinder & operator<< | ( | const int64_t & | value | ) |
Bind a 64-bit integer value to the next query parameter.
value | The value to bind. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all parameters have already been bound. |
SQLValueBinder & operator<< | ( | const double & | value | ) |
Bind a double-precision floating point value to the next query parameter.
value | The value to bind. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all parameters have already been bound. |
SQLValueBinder & operator<< | ( | const String & | value | ) |
Bind a String value to the next query parameter.
value | The value to bind. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all parameters have already been bound. |
SQLValueBinder & operator<< | ( | const char * | value | ) |
Bind a string value to the next query parameter.
value | The value to bind. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all parameters have already been bound. |
SQLValueBinder & operator<< | ( | const Blob & | value | ) |
Bind a Blob value to the next query parameter.
value | The value to bind. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all parameters have already been bound. |
SQLValueBinder & operator>> | ( | bool & | value | ) |
Extract a boolean value from the next field in the results.
value | The value to extract into. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all fields have already been extracted. |
SQLValueBinder & operator>> | ( | int & | value | ) |
Extract an integer value from the next field in the results.
value | The value to extract into. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all fields have already been extracted. |
SQLValueBinder & operator>> | ( | int64_t & | value | ) |
Extract a 64-bit integer value from the next field in the results.
value | The value to extract into. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all fields have already been extracted. |
SQLValueBinder & operator>> | ( | double & | value | ) |
Extract a double-precision floating point value from the next field in the results.
value | The value to extract into. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all fields have already been extracted. |
SQLValueBinder & operator>> | ( | String & | value | ) |
Extract a String value from the next field in the results.
value | The value to extract into. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all fields have already been extracted. |
SQLValueBinder & operator>> | ( | Blob & | value | ) |
Extract a Blob value from the next field in the results.
value | The value to extract into. |
SQLException | If a database error occurs. |
OutOfBoundsException | If all fields have already been extracted. |
void reset | ( | ) |
Reset the SQLValueBinder.
The next binding/extraction will take place at the first parameter/field.