28 #if !defined(MYSQLPP_VALLIST_H)
29 #define MYSQLPP_VALLIST_H
59 template <
class Seq1,
class Seq2,
class Manip>
92 const char* e, Manip m) :
114 template <
class Seq1,
class Seq2,
class Manip>
153 const std::vector<bool>& f,
const char* d,
154 const char* e, Manip m) :
185 template <
class Seq,
class Manip>
225 template <
class Seq,
class Manip>
253 const char* d, Manip m) :
272 template <
class Seq1,
class Seq2,
class Manip>
273 std::ostream& operator <<(std::ostream& o,
276 typename Seq1::const_iterator i = el.
list1->begin();
277 typename Seq2::const_iterator j = el.
list2->begin();
281 if ((++i == el.
list1->end()) || (++j == el.
list2->end())) {
296 template <
class Seq1,
class Seq2,
class Manip>
297 std::ostream& operator <<(std::ostream& o,
300 typename Seq1::const_iterator i = el.
list1->begin();
301 typename Seq2::const_iterator j = el.
list2->begin();
308 if ((++i == el.
list1->end()) || (++j == el.
list2->end())) {
329 template <
class Seq,
class Manip>
330 std::ostream& operator <<(std::ostream& o,
333 typename Seq::const_iterator i = cl.
list->begin();
337 if (++i == cl.
list->end()) {
352 template <
class Seq,
class Manip>
353 std::ostream& operator <<(std::ostream& o,
356 typename Seq::const_iterator i = cl.
list->begin();
363 if (++i == cl.
list->end()) {
385 void create_vector(
size_t size, std::vector<bool>& v,
bool t0,
386 bool t1 =
false,
bool t2 =
false,
bool t3 =
false,
387 bool t4 =
false,
bool t5 =
false,
bool t6 =
false,
388 bool t7 =
false,
bool t8 =
false,
bool t9 =
false,
389 bool ta =
false,
bool tb =
false,
bool tc =
false);
404 template <
class Container>
405 void create_vector(
const Container& c, std::vector<bool>& v,
406 std::string s0, std::string s1, std::string s2,
407 std::string s3, std::string s4, std::string s5,
408 std::string s6, std::string s7, std::string s8,
409 std::string s9, std::string sa, std::string sb,
425 value_list_ba<Seq, do_nothing_type0>
438 template <
class Seq,
class Manip>
439 value_list_ba<Seq, Manip>
455 template <
class Seq,
class Manip>
456 inline value_list_b<Seq, Manip>
458 const std::vector<bool>& vb)
470 template <
class Seq,
class Manip>
471 value_list_b<Seq, Manip>
473 bool t1 =
false,
bool t2 =
false,
bool t3 =
false,
474 bool t4 =
false,
bool t5 =
false,
bool t6 =
false,
475 bool t7 =
false,
bool t8 =
false,
bool t9 =
false,
476 bool ta =
false,
bool tb =
false,
bool tc =
false)
478 std::vector<bool> vb;
479 create_vector(s.size(), vb, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9,
492 value_list_b<Seq, do_nothing_type0>
494 bool t1 =
false,
bool t2 =
false,
bool t3 =
false,
495 bool t4 =
false,
bool t5 =
false,
bool t6 =
false,
496 bool t7 =
false,
bool t8 =
false,
bool t9 =
false,
497 bool ta =
false,
bool tb =
false,
bool tc =
false)
499 std::vector<bool> vb;
500 create_vector(s.size(), vb, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9,
516 value_list_b<Seq, do_nothing_type0>
518 bool t1 =
false,
bool t2 =
false,
bool t3 =
false,
519 bool t4 =
false,
bool t5 =
false,
bool t6 =
false,
520 bool t7 =
false,
bool t8 =
false,
bool t9 =
false,
521 bool ta =
false,
bool tb =
false,
bool tc =
false)
523 std::vector<bool> vb;
524 create_vector(s.size(), vb, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9,
551 template <
class Seq1,
class Seq2>
552 equal_list_ba<Seq1, Seq2, do_nothing_type0>
553 equal_list(
const Seq1& s1,
const Seq2& s2,
const char *d =
",",
554 const char *e =
" = ")
567 template <
class Seq1,
class Seq2,
class Manip>
568 equal_list_ba<Seq1, Seq2, Manip>
570 const char* e, Manip m)
584 template <
class Seq1,
class Seq2,
class Manip>
585 equal_list_b<Seq1, Seq2, Manip>
587 const char *e, Manip m,
const std::vector<bool>& vb)
599 template <
class Seq1,
class Seq2,
class Manip>
600 equal_list_b<Seq1, Seq2, Manip>
602 const char* e, Manip m,
bool t0,
bool t1 =
false,
603 bool t2 =
false,
bool t3 =
false,
bool t4 =
false,
604 bool t5 =
false,
bool t6 =
false,
bool t7 =
false,
605 bool t8 =
false,
bool t9 =
false,
bool ta =
false,
606 bool tb =
false,
bool tc =
false)
608 std::vector<bool> vb;
609 create_vector(s1.size(), vb, t0, t1, t2, t3, t4, t5, t6, t7, t8,
622 template <
class Seq1,
class Seq2>
623 equal_list_b<Seq1, Seq2, do_nothing_type0>
625 const char* e,
bool t0,
bool t1 =
false,
bool t2 =
false,
626 bool t3 =
false,
bool t4 =
false,
bool t5 =
false,
627 bool t6 =
false,
bool t7 =
false,
bool t8 =
false,
628 bool t9 =
false,
bool ta =
false,
bool tb =
false,
631 std::vector<bool> vb;
632 create_vector(s1.size(), vb, t0, t1, t2, t3, t4, t5, t6, t7, t8,
645 template <
class Seq1,
class Seq2>
646 equal_list_b<Seq1, Seq2, do_nothing_type0>
647 equal_list(
const Seq1& s1,
const Seq2& s2,
const char* d,
bool t0,
648 bool t1 =
false,
bool t2 =
false,
bool t3 =
false,
649 bool t4 =
false,
bool t5 =
false,
bool t6 =
false,
650 bool t7 =
false,
bool t8 =
false,
bool t9 =
false,
651 bool ta =
false,
bool tb =
false,
bool tc =
false)
653 std::vector<bool> vb;
654 create_vector(s1.size(), vb, t0, t1, t2, t3, t4, t5, t6, t7, t8,
669 template <
class Seq1,
class Seq2>
670 equal_list_b<Seq1, Seq2, do_nothing_type0>
671 equal_list(
const Seq1& s1,
const Seq2& s2,
bool t0,
bool t1 =
false,
672 bool t2 =
false,
bool t3 =
false,
bool t4 =
false,
673 bool t5 =
false,
bool t6 =
false,
bool t7 =
false,
674 bool t8 =
false,
bool t9 =
false,
bool ta =
false,
675 bool tb =
false,
bool tc =
false)
677 std::vector<bool> vb;
678 create_vector(s1.size(), vb, t0, t1, t2, t3, t4, t5, t6, t7, t8,
Declares the Query stream manipulators and operators.
@ do_nothing
insert into a std::ostream to override manipulation of next item
Definition: manip.h:389
Same as equal_list_ba, plus the option to have some elements of the equals clause suppressed.
Definition: vallist.h:116
Manip manip
manipulator to use when inserting the equal_list into a C++ stream
Definition: vallist.h:138
equal_list_b(const Seq1 &s1, const Seq2 &s2, const std::vector< bool > &f, const char *d, const char *e, Manip m)
Create object.
Definition: vallist.h:152
const std::vector< bool > fields
for each true item in the list, the pair in that position will be inserted into a C++ stream
Definition: vallist.h:127
const char * equl
"equal" sign to use between each item in each equal pair; doesn't have to actually be " = "
Definition: vallist.h:134
const Seq1 * list1
the list of objects on the left-hand side of the equals sign
Definition: vallist.h:119
const char * delim
delimiter to use between each pair of elements
Definition: vallist.h:130
const Seq2 * list2
the list of objects on the right-hand side of the equals sign
Definition: vallist.h:123
Holds two lists of items, typically used to construct a SQL "equals clause".
Definition: vallist.h:61
const char * delim
delimiter to use between each pair of elements
Definition: vallist.h:71
equal_list_ba(const Seq1 &s1, const Seq2 &s2, const char *d, const char *e, Manip m)
Create object.
Definition: vallist.h:91
const Seq2 * list2
the list of objects on the right-hand side of the equals sign
Definition: vallist.h:68
const char * equl
"equal" sign to use between each item in each equal pair; doesn't have to actually be " = "
Definition: vallist.h:75
Manip manip
manipulator to use when inserting the equal_list into a C++ stream
Definition: vallist.h:79
const Seq1 * list1
the list of objects on the left-hand side of the equals sign
Definition: vallist.h:64
Same as value_list_ba, plus the option to have some elements of the list suppressed.
Definition: vallist.h:227
const Seq * list
set of objects in the value list
Definition: vallist.h:229
value_list_b(const Seq &s, const std::vector< bool > &f, const char *d, Manip m)
Create object.
Definition: vallist.h:252
const char * delim
delimiter to use between each value in the list when inserting it into a C++ stream
Definition: vallist.h:237
const std::vector< bool > fields
delimiter to use between each value in the list when inserting it into a C++ stream
Definition: vallist.h:233
Manip manip
manipulator to use when inserting the list into a C++ stream
Definition: vallist.h:241
Holds a list of items, typically used to construct a SQL "value list".
Definition: vallist.h:187
value_list_ba(const Seq &s, const char *d, Manip m)
Create object.
Definition: vallist.h:206
const char * delim
delimiter to use between each value in the list when inserting it into a C++ stream
Definition: vallist.h:193
Manip manip
manipulator to use when inserting the list into a C++ stream
Definition: vallist.h:197
const Seq * list
set of objects in the value list
Definition: vallist.h:189
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.
Definition: vallist.h:553
value_list_ba< Seq, do_nothing_type0 > value_list(const Seq &s, const char *d=",")
Constructs a value_list_ba.
Definition: vallist.h:426