values.cpp
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 //
7 
8 #define SOCI_SOURCE
9 #include "values.h"
10 #include "row.h"
11 
12 #include <cstddef>
13 #include <map>
14 #include <sstream>
15 #include <string>
16 
17 using namespace soci;
18 using namespace soci::details;
19 
20 indicator values::get_indicator(std::size_t pos) const
21 {
22  if (row_)
23  {
24  return row_->get_indicator(pos);
25  }
26  else
27  {
28  return *indicators_[pos];
29  }
30 }
31 
32 indicator values::get_indicator(std::string const& name) const
33 {
34  if (row_)
35  {
36  return row_->get_indicator(name);
37  }
38  else
39  {
40  std::map<std::string, std::size_t>::const_iterator it = index_.find(name);
41  if (it == index_.end())
42  {
43  std::ostringstream msg;
44  msg << "Column '" << name << "' not found";
45  throw soci_error(msg.str());
46  }
47  return *indicators_[it->second];
48  }
49 }
50 
51 column_properties const& values::get_properties(std::size_t pos) const
52 {
53  if (row_)
54  {
55  return row_->get_properties(pos);
56  }
57 
58  throw soci_error("Rowset is empty");
59 }
60 
61 column_properties const& values::get_properties(std::string const& name) const
62 {
63  if (row_)
64  {
65  return row_->get_properties(name);
66  }
67 
68  throw soci_error("Rowset is empty");
69 }
indicator get_indicator(std::size_t pos) const
Definition: values.cpp:20
column_properties const & get_properties(std::size_t pos) const
Definition: values.cpp:51


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:41