28 #if !defined(MYSQLPP_ROW_H)
43 #if !defined(DOXYGEN_IGNORE)
46 class MYSQLPP_EXPORT ResultBase;
63 class MYSQLPP_EXPORT Row :
public OptionalExceptions
70 typedef bool Row::*private_bool_type;
77 typedef std::vector<String> list_type;
80 typedef list_type::const_iterator const_iterator;
83 typedef list_type::const_reference const_reference;
86 typedef list_type::const_reverse_iterator const_reverse_iterator;
89 typedef list_type::difference_type difference_type;
97 typedef const_iterator iterator;
102 typedef const_reference reference;
108 typedef const_reverse_iterator reverse_iterator;
111 typedef list_type::size_type size_type;
114 typedef list_type::value_type value_type;
125 data_(r.data_.begin(), r.data_.end()),
126 field_names_(r.field_names_),
127 initialized_(r.initialized_)
138 const unsigned long* lengths,
bool te =
true);
147 const_reference at(size_type i)
const;
150 const_reference back()
const {
return data_.back(); }
154 const_iterator begin()
const {
return data_.begin(); }
157 bool empty()
const {
return data_.empty(); }
169 equal_list(
const char* d =
",",
const char* e =
" = ")
const;
191 template <
class Manip>
193 const char* e, Manip m)
const;
200 field_list(
const char* d =
",")
const;
208 template <
class Manip>
220 template <
class Manip>
222 const std::vector<bool>& vb)
const;
234 const char* d,
const std::vector<bool>& vb)
const;
244 const std::vector<bool>& vb)
const;
253 template <
class Manip>
256 bool t1 =
false,
bool t2 =
false,
bool t3 =
false,
257 bool t4 =
false,
bool t5 =
false,
bool t6 =
false,
258 bool t7 =
false,
bool t8 =
false,
bool t9 =
false,
259 bool ta =
false,
bool tb =
false,
bool tc =
false)
const;
269 const char *d,
bool t0,
270 bool t1 =
false,
bool t2 =
false,
bool t3 =
false,
271 bool t4 =
false,
bool t5 =
false,
bool t6 =
false,
272 bool t7 =
false,
bool t8 =
false,
bool t9 =
false,
273 bool ta =
false,
bool tb =
false,
bool tc =
false)
const;
283 bool t1 =
false,
bool t2 =
false,
bool t3 =
false,
284 bool t4 =
false,
bool t5 =
false,
bool t6 =
false,
285 bool t7 =
false,
bool t8 =
false,
bool t9 =
false,
286 bool ta =
false,
bool tb =
false,
bool tc =
false)
const;
289 size_type field_num(
const char* name)
const;
296 size_type max_size()
const {
return data_.max_size(); }
299 Row& operator =(
const Row& rhs)
301 data_.assign(rhs.data_.begin(), rhs.data_.end());
302 field_names_.assign(rhs.field_names_);
303 initialized_ = rhs.initialized_;
314 const_reference operator [](
const char* field)
const;
327 const_reference operator [](
int i)
const
328 {
return at(
static_cast<size_type
>(i)); }
347 operator private_bool_type()
const
349 return data_.size() && initialized_ ? &Row::initialized_ : 0;
354 const_reverse_iterator rbegin()
const {
return data_.rbegin(); }
358 const_reverse_iterator rend()
const {
return data_.rend(); }
361 size_type size()
const {
return data_.size(); }
371 template <
class Manip>
373 Manip m = quote)
const
384 template <
class Manip>
386 const std::vector<bool>& vb, Manip m = quote)
const
399 const std::vector<bool> &vb)
const
410 template <
class Manip>
412 bool t0,
bool t1 =
false,
bool t2 =
false,
bool t3 =
false,
413 bool t4 =
false,
bool t5 =
false,
bool t6 =
false,
414 bool t7 =
false,
bool t8 =
false,
bool t9 =
false,
415 bool ta =
false,
bool tb =
false,
bool tc =
false)
const
417 std::vector<bool> vb;
418 create_vector(size(), vb, t0, t1, t2, t3, t4, t5, t6,
419 t7, t8, t9, ta, tb, tc);
430 value_list(
const char *d,
bool t0,
bool t1 =
false,
bool t2 =
false,
431 bool t3 =
false,
bool t4 =
false,
bool t5 =
false,
432 bool t6 =
false,
bool t7 =
false,
bool t8 =
false,
433 bool t9 =
false,
bool ta =
false,
bool tb =
false,
434 bool tc =
false)
const
436 std::vector<bool> vb;
437 create_vector(size(), vb, t0, t1, t2, t3, t4, t5, t6,
438 t7, t8, t9, ta, tb, tc);
449 bool t1 =
false,
bool t2 =
false,
bool t3 =
false,
450 bool t4 =
false,
bool t5 =
false,
bool t6 =
false,
451 bool t7 =
false,
bool t8 =
false,
bool t9 =
false,
452 bool ta =
false,
bool tb =
false,
bool tc =
false)
const
454 std::vector<bool> vb;
455 create_vector(size(), vb, t0, t1, t2, t3, t4, t5, t6,
456 t7, t8, t9, ta, tb, tc);
466 template <
class Manip>
468 std::string s0, std::string s1 =
"", std::string s2 =
"",
469 std::string s3 =
"", std::string s4 =
"",
470 std::string s5 =
"", std::string s6 =
"",
471 std::string s7 =
"", std::string s8 =
"",
472 std::string s9 =
"", std::string sa =
"",
473 std::string sb =
"", std::string sc =
"")
const
475 std::vector<bool> vb;
476 create_vector(*
this, vb, s0, s1, s2, s3, s4, s5, s6, s7, s8,
489 std::string s0, std::string s1 =
"", std::string s2 =
"",
490 std::string s3 =
"", std::string s4 =
"",
491 std::string s5 =
"", std::string s6 =
"",
492 std::string s7 =
"", std::string s8 =
"",
493 std::string s9 =
"", std::string sa =
"",
494 std::string sb =
"", std::string sc =
"")
const
496 std::vector<bool> vb;
497 create_vector(*
this, vb, s0, s1, s2, s3, s4, s5, s6, s7, s8,
510 std::string s1 =
"", std::string s2 =
"",
511 std::string s3 =
"", std::string s4 =
"",
512 std::string s5 =
"", std::string s6 =
"",
513 std::string s7 =
"", std::string s8 =
"",
514 std::string s9 =
"", std::string sa =
"",
515 std::string sb =
"", std::string sc =
"")
const
517 std::vector<bool> vb;
518 create_vector(*
this, vb, s0, s1, s2, s3, s4, s5, s6, s7, s8,
531 #endif // !defined(MYSQLPP_ROW_H)