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>
127 const std::vector<bool>
fields;
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>
233 const std::vector<bool>
fields;
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();
280 o << *i << el.equl << el.manip << *j;
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();
360 if (cl.fields[k++]) {
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>
426 value_list(
const Seq& s,
const char* d =
",")
428 return value_list_ba<Seq, do_nothing_type0>(s, d, do_nothing);
438 template <
class Seq,
class Manip>
439 value_list_ba<Seq, Manip>
440 value_list(
const Seq& s,
const char* d, Manip m)
442 return value_list_ba<Seq, Manip>(s, d, m);
455 template <
class Seq,
class Manip>
456 inline value_list_b<Seq, Manip>
457 value_list(
const Seq& s,
const char* d, Manip m,
458 const std::vector<bool>& vb)
460 return value_list_b<Seq, Manip>(s, vb, d, m);
470 template <
class Seq,
class Manip>
472 value_list(
const Seq& s,
const char* d, Manip m,
bool t0,
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>
493 value_list(
const Seq& s,
const char* d,
bool t0,
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,
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 =
" = ")
556 return equal_list_ba<Seq1, Seq2, do_nothing_type0>(s1, s2, d,
567 template <
class Seq1,
class Seq2,
class Manip>
568 equal_list_ba<Seq1, Seq2, Manip>
569 equal_list(
const Seq1& s1,
const Seq2& s2,
const char* d,
570 const char* e, Manip m)
572 return equal_list_ba<Seq1, Seq2, Manip>(s1, s2, d, e, m);
584 template <
class Seq1,
class Seq2,
class Manip>
586 equal_list(
const Seq1& s1,
const Seq2& s2,
const char* d,
587 const char *e, Manip m,
const std::vector<bool>& vb)
599 template <
class Seq1,
class Seq2,
class Manip>
601 equal_list(
const Seq1& s1,
const Seq2& s2,
const char* d,
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>
624 equal_list(
const Seq1& s1,
const Seq2& s2,
const char* d,
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>
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>
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,
686 #endif // !defined(MYSQLPP_VALLIST_H)