Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

# vallist.h File Reference

Declares templates for holding lists of values. More...

`#include "manip.h"`
`#include <string>`
`#include <vector>`

Go to the source code of this file.

## Namespaces
namespace | mysqlpp
## Classes
struct | mysqlpp::equal_list_ba< Seq1, Seq2, Manip >
| Holds two lists of items, typically used to construct a SQL "equals clause". More...
struct | mysqlpp::equal_list_b< Seq1, Seq2, Manip >
| Same as equal_list_ba, plus the option to have some elements of the equals clause suppressed. More...
struct | mysqlpp::value_list_ba< Seq, Manip >
| Holds a list of items, typically used to construct a SQL "value list". More...
struct | mysqlpp::value_list_b< Seq, Manip >
| Same as value_list_ba, plus the option to have some elements of the list suppressed. More...
## Functions
template<class Seq1, class Seq2, class Manip>
std::ostream & | operator<< (std::ostream &o, const equal_list_ba< Seq1, Seq2, Manip > &el)
| Inserts an equal_list_ba into an std::ostream.
template<class Seq1, class Seq2, class Manip>
std::ostream & | operator<< (std::ostream &o, const equal_list_b< Seq1, Seq2, Manip > &el)
| Same as operator<< for equal_list_ba, plus the option to suppress insertion of some list items in the stream.
template<class Seq, class Manip>
std::ostream & | operator<< (std::ostream &o, const value_list_ba< Seq, Manip > &cl)
| Inserts a value_list_ba into an std::ostream.
template<class Seq, class Manip>
std::ostream & | operator<< (std::ostream &o, const value_list_b< Seq, Manip > &cl)
| Same as operator<< for value_list_ba, plus the option to suppress insertion of some list items in the stream.
template<class Seq>
value_list_ba< Seq, do_nothing_type0 > | value_list (const Seq &s, const char *d=",")
| Constructs a value_list_ba.
template<class Seq, class Manip>
value_list_ba< Seq, Manip > | value_list (const Seq &s, const char *d, Manip m)
| Constructs a value_list_ba.
template<class Seq, class Manip>
value_list_b< Seq, Manip > | value_list (const Seq &s, const char *d, Manip m, const std::vector< bool > &vb)
| Constructs a value_list_b (sparse value list).
template<class Seq, class Manip>
value_list_b< Seq, Manip > | value_list (const Seq &s, 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)
| Constructs a value_list_b (sparse value list).
template<class Seq>
value_list_b< Seq, do_nothing_type0 > | value_list (const Seq &s, 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)
| Constructs a sparse value list.
template<class Seq>
value_list_b< Seq, do_nothing_type0 > | value_list (const Seq &s, 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)
| Constructs a sparse value list.
template<class Seq1, class Seq2>
equal_list_ba< Seq1, Seq2, do_nothing_type0 > | equal_list (const Seq1 &s1, const Seq2 &s2, const char *d=",", const char *e=" = ")
| Constructs an equal_list_ba.
template<class Seq1, class Seq2, class Manip>
equal_list_ba< Seq1, Seq2, Manip > | equal_list (const Seq1 &s1, const Seq2 &s2, const char *d, const char *e, Manip m)
| Constructs an equal_list_ba.
template<class Seq1, class Seq2, class Manip>
equal_list_b< Seq1, Seq2, Manip > | equal_list (const Seq1 &s1, const Seq2 &s2, const char *d, const char *e, Manip m, const std::vector< bool > &vb)
| Constructs a equal_list_b (sparse equal list).
template<class Seq1, class Seq2, class Manip>
equal_list_b< Seq1, Seq2, Manip > | equal_list (const Seq1 &s1, const Seq2 &s2, const char *d, const char *e, 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)
| Constructs a equal_list_b (sparse equal list).
template<class Seq1, class Seq2>
equal_list_b< Seq1, Seq2, do_nothing_type0 > | equal_list (const Seq1 &s1, const Seq2 &s2, const char *d, const char *e, 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)
| Constructs a equal_list_b (sparse equal list).
template<class Seq1, class Seq2>
equal_list_b< Seq1, Seq2, do_nothing_type0 > | equal_list (const Seq1 &s1, const Seq2 &s2, 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)
| Constructs a equal_list_b (sparse equal list).
template<class Seq1, class Seq2>
equal_list_b< Seq1, Seq2, do_nothing_type0 > | equal_list (const Seq1 &s1, const Seq2 &s2, 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)
| Constructs a equal_list_b (sparse equal list).

## Detailed Description

Declares templates for holding lists of values.

## Function Documentation

template<class Seq1, class Seq2>
equal_list_b<Seq1, Seq2, do_nothing_type0> equal_list | ( | const Seq1 & | s1,
|  | const Seq2 & | s2,
|  | 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`
| ) |

| Constructs a equal_list_b (sparse equal list). Same as equal_list(Seq&, Seq&, const char*, bool, bool...) except that it doesn't take the const char* argument. It uses a comma for the delimiter. This form is useful for building simple equals lists, where no manipulators are necessary, and the default delimiter and equals symbol are suitable.

template<class Seq1, class Seq2>
equal_list_b<Seq1, Seq2, do_nothing_type0> equal_list | ( | const Seq1 & | s1,
|  | const Seq2 & | s2,
|  | 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`
| ) |

| Constructs a equal_list_b (sparse equal list). Same as equal_list(Seq&, Seq&, const char*, const char*, bool, bool...) except that it doesn't take the second const char* argument. It uses " = " for the equals symbol.

template<class Seq1, class Seq2>
equal_list_b<Seq1, Seq2, do_nothing_type0> equal_list | ( | const Seq1 & | s1,
|  | const Seq2 & | s2,
|  | const char * | d,
|  | const char * | e,
|  | 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`
| ) |

| Constructs a equal_list_b (sparse equal list). Same as equal_list(Seq&, Seq&, const char*, const char*, Manip, bool, bool...) except that it doesn't take the Manip argument. It uses the do_nothing manipulator instead, meaning that none of the elements are escaped when being inserted into a stream.

template<class Seq1, class Seq2, class Manip>
equal_list_b<Seq1, Seq2, Manip> equal_list | ( | const Seq1 & | s1,
|  | const Seq2 & | s2,
|  | const char * | d,
|  | const char * | e,
|  | 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`
| ) |

| Constructs a equal_list_b (sparse equal list). Same as equal_list(Seq&, Seq&, const char*, const char*, Manip, vector<bool>&) except that it takes boolean parameters instead of a list of bools.

template<class Seq1, class Seq2, class Manip>
equal_list_b<Seq1, Seq2, Manip> equal_list | ( | const Seq1 & | s1,
|  | const Seq2 & | s2,
|  | const char * | d,
|  | const char * | e,
|  | Manip | m,
|  | const std::vector< bool > & | vb
| ) |

| Constructs a equal_list_b (sparse equal list). Same as equal_list(Seq&, Seq&, const char*, const char*, Manip) except that you can pass a vector of bools. For each true item in that list, operator<< adds the corresponding item is put in the equal list. This lets you pass in sequences when you don't want all of the elements to be inserted into a stream.

template<class Seq1, class Seq2, class Manip>
equal_list_ba<Seq1, Seq2, Manip> equal_list | ( | const Seq1 & | s1,
|  | const Seq2 & | s2,
|  | const char * | d,
|  | const char * | e,
|  | Manip | m
| ) |

| Constructs an equal_list_ba. Same as equal_list(Seq&, Seq&, const char*, const char*) except that it also lets you specify the manipulator. Use this version if the data must be escaped or quoted when being inserted into a stream.

template<class Seq1, class Seq2>
equal_list_ba<Seq1, Seq2, do_nothing_type0> equal_list | ( | const Seq1 & | s1,
|  | const Seq2 & | s2,
|  | const char * | d = `","`,
|  | const char * | e = `" = "`
| ) |

  | Constructs an equal_list_ba. This function returns an equal list that uses the 'do_nothing' manipulator. That is, the items are not quoted or escaped in any way when inserted into a stream. See equal_list(Seq, Seq, const char*, const char*, Manip) if you need a different manipulator. The idea is for both lists to be of equal length because corresponding elements from each list are handled as pairs, but if one list is shorter than the other, the generated list will have that many elements. Parameters:
  | s1 | items on the left side of the equals sign when the equal list is inserted into a stream
  | s2 | items on the right side of the equals sign
  | d | delimiter operator<< should place between pairs
  | e | what operator<< should place between items in each pair; by default, an equals sign, as that is the primary use for this mechanism.

template<class Seq, class Manip>
std::ostream& operator<< | ( | std::ostream & | o,
|  | const value_list_b< Seq, Manip > & | cl
| ) |

| Same as operator<< for value_list_ba, plus the option to suppress insertion of some list items in the stream. See value_list_b's documentation for examples of how this works.

template<class Seq, class Manip>
std::ostream& operator<< | ( | std::ostream & | o,
|  | const value_list_ba< Seq, Manip > & | cl
| ) |

| Inserts a value_list_ba into an std::ostream. Given a list (a, b) and a delimiter D, this operator will insert "aDb" into the stream. See value_list_ba's documentation for concrete examples. See also: value_list()

template<class Seq1, class Seq2, class Manip>
std::ostream& operator<< | ( | std::ostream & | o,
|  | const equal_list_b< Seq1, Seq2, Manip > & | el
| ) |

| Same as operator<< for equal_list_ba, plus the option to suppress insertion of some list items in the stream. See equal_list_b's documentation for examples of how this works.

template<class Seq1, class Seq2, class Manip>
std::ostream& operator<< | ( | std::ostream & | o,
|  | const equal_list_ba< Seq1, Seq2, Manip > & | el
| ) |

| Inserts an equal_list_ba into an std::ostream. Given two lists (a, b) and (c, d), a delimiter D, and an equals symbol E, this operator will insert "aEcDbEd" into the stream. See equal_list_ba's documentation for concrete examples. See also: equal_list()

template<class Seq>
value_list_b<Seq, do_nothing_type0> value_list | ( | const Seq & | s,
|  | 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`
| ) |

| Constructs a sparse value list. Same as value_list(Seq&, const char*, Manip, bool, bool...) but without the Manip or delimiter parameters. We use the do_nothing manipulator, meaning that the value list items are neither escaped nor quoted when being inserted into a stream. The delimiter is a comma. This form is suitable for lists of simple data, such as integers.

template<class Seq>
value_list_b<Seq, do_nothing_type0> value_list | ( | const Seq & | s,
|  | 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`
| ) |

| Constructs a sparse value list. Same as value_list(Seq&, const char*, Manip, bool, bool...) but without the Manip parameter. We use the do_nothing manipulator, meaning that the value list items are neither escaped nor quoted when being inserted into a stream.

template<class Seq, class Manip>
value_list_b<Seq, Manip> value_list | ( | const Seq & | s,
|  | 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`
| ) |

| Constructs a value_list_b (sparse value list). Same as value_list(Seq&, const char*, Manip, const vector<bool>&), except that it takes the bools as arguments instead of wrapped up in a vector object.

template<class Seq, class Manip>
value_list_b<Seq, Manip> value_list | ( | const Seq & | s,
|  | const char * | d,
|  | Manip | m,
|  | const std::vector< bool > & | vb
| ) | `[inline]`

  | Constructs a value_list_b (sparse value list). Parameters:
  | s | an STL sequence of items in the value list
  | d | delimiter operator<< should place between items
  | m | manipulator to use when inserting items into a stream
  | vb | for each item in this vector that is true, the corresponding item in the value list is inserted into a stream; the others are suppressed

template<class Seq, class Manip>
value_list_ba<Seq, Manip> value_list | ( | const Seq & | s,
|  | const char * | d,
|  | Manip | m
| ) |

  | Constructs a value_list_ba. Parameters:
  | s | an STL sequence of items in the value list
  | d | delimiter operator<< should place between items
  | m | manipulator to use when inserting items into a stream

template<class Seq>
value_list_ba<Seq, do_nothing_type0> value_list | ( | const Seq & | s,
|  | const char * | d = `","`
| ) |

  | Constructs a value_list_ba. This function returns a value list that uses the 'do_nothing' manipulator. That is, the items are not quoted or escaped in any way. See value_list(Seq, const char*, Manip) if you need to specify a manipulator. Parameters:
  | s | an STL sequence of items in the value list
  | d | delimiter operator<< should place between items