libcommonc++  0.7
SQLValueBinder Class Reference

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...
 
SQLValueBinderoperator<< (bool value)
 Bind a boolean value to the next query parameter. More...
 
SQLValueBinderoperator<< (int value)
 Bind an integer value to the next query parameter. More...
 
SQLValueBinderoperator<< (const int64_t &value)
 Bind a 64-bit integer value to the next query parameter. More...
 
SQLValueBinderoperator<< (const double &value)
 Bind a double-precision floating point value to the next query parameter. More...
 
SQLValueBinderoperator<< (const String &value)
 Bind a String value to the next query parameter. More...
 
SQLValueBinderoperator<< (const char *value)
 Bind a string value to the next query parameter. More...
 
SQLValueBinderoperator<< (const Blob &value)
 Bind a Blob value to the next query parameter. More...
 
SQLValueBinderoperator>> (bool &value)
 Extract a boolean value from the next field in the results. More...
 
SQLValueBinderoperator>> (int &value)
 Extract an integer value from the next field in the results. More...
 
SQLValueBinderoperator>> (int64_t &value)
 Extract a 64-bit integer value from the next field in the results. More...
 
SQLValueBinderoperator>> (double &value)
 Extract a double-precision floating point value from the next field in the results. More...
 
SQLValueBinderoperator>> (String &value)
 Extract a String value from the next field in the results. More...
 
SQLValueBinderoperator>> (Blob &value)
 Extract a Blob value from the next field in the results. More...
 
void reset ()
 Reset the SQLValueBinder. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SQLValueBinder()

SQLValueBinder ( SQLQuery query)

Construct a new SQLValueBinder for the given SQLQuery.

◆ ~SQLValueBinder()

Destructor.

Member Function Documentation

◆ operator<<() [1/7]

SQLValueBinder & operator<< ( bool  value)

Bind a boolean value to the next query parameter.

Parameters
valueThe value to bind.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all parameters have already been bound.

◆ operator<<() [2/7]

SQLValueBinder & operator<< ( int  value)

Bind an integer value to the next query parameter.

Parameters
valueThe value to bind.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all parameters have already been bound.

◆ operator<<() [3/7]

SQLValueBinder & operator<< ( const int64_t &  value)

Bind a 64-bit integer value to the next query parameter.

Parameters
valueThe value to bind.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all parameters have already been bound.

◆ operator<<() [4/7]

SQLValueBinder & operator<< ( const double &  value)

Bind a double-precision floating point value to the next query parameter.

Parameters
valueThe value to bind.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all parameters have already been bound.

◆ operator<<() [5/7]

SQLValueBinder & operator<< ( const String value)

Bind a String value to the next query parameter.

Parameters
valueThe value to bind.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all parameters have already been bound.

◆ operator<<() [6/7]

SQLValueBinder & operator<< ( const char *  value)

Bind a string value to the next query parameter.

Parameters
valueThe value to bind.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all parameters have already been bound.

◆ operator<<() [7/7]

SQLValueBinder & operator<< ( const Blob value)

Bind a Blob value to the next query parameter.

Parameters
valueThe value to bind.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all parameters have already been bound.

◆ operator>>() [1/6]

SQLValueBinder & operator>> ( bool &  value)

Extract a boolean value from the next field in the results.

Parameters
valueThe value to extract into.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all fields have already been extracted.

◆ operator>>() [2/6]

SQLValueBinder & operator>> ( int &  value)

Extract an integer value from the next field in the results.

Parameters
valueThe value to extract into.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all fields have already been extracted.

◆ operator>>() [3/6]

SQLValueBinder & operator>> ( int64_t &  value)

Extract a 64-bit integer value from the next field in the results.

Parameters
valueThe value to extract into.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all fields have already been extracted.

◆ operator>>() [4/6]

SQLValueBinder & operator>> ( double &  value)

Extract a double-precision floating point value from the next field in the results.

Parameters
valueThe value to extract into.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all fields have already been extracted.

◆ operator>>() [5/6]

SQLValueBinder & operator>> ( String value)

Extract a String value from the next field in the results.

Parameters
valueThe value to extract into.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all fields have already been extracted.

◆ operator>>() [6/6]

SQLValueBinder & operator>> ( Blob value)

Extract a Blob value from the next field in the results.

Parameters
valueThe value to extract into.
Exceptions
SQLExceptionIf a database error occurs.
OutOfBoundsExceptionIf all fields have already been extracted.

◆ reset()

void reset ( )

Reset the SQLValueBinder.

The next binding/extraction will take place at the first parameter/field.


The documentation for this class was generated from the following files: