Warning, file /sdk/codevis/thirdparty/soci/src/core/values.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 // 0002 // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton 0003 // Distributed under the Boost Software License, Version 1.0. 0004 // (See accompanying file LICENSE_1_0.txt or copy at 0005 // http://www.boost.org/LICENSE_1_0.txt) 0006 // 0007 0008 #define SOCI_SOURCE 0009 #include "soci/values.h" 0010 #include "soci/row.h" 0011 0012 #include <cstddef> 0013 #include <map> 0014 #include <sstream> 0015 #include <string> 0016 0017 using namespace soci; 0018 using namespace soci::details; 0019 0020 indicator values::get_indicator(std::size_t pos) const 0021 { 0022 if (row_) 0023 { 0024 return row_->get_indicator(pos); 0025 } 0026 else 0027 { 0028 return *indicators_[pos]; 0029 } 0030 } 0031 0032 indicator values::get_indicator(std::string const& name) const 0033 { 0034 if (row_) 0035 { 0036 return row_->get_indicator(name); 0037 } 0038 else 0039 { 0040 std::map<std::string, std::size_t>::const_iterator it = index_.find(name); 0041 if (it == index_.end()) 0042 { 0043 std::ostringstream msg; 0044 msg << "Column '" << name << "' not found"; 0045 throw soci_error(msg.str()); 0046 } 0047 return *indicators_[it->second]; 0048 } 0049 } 0050 0051 column_properties const& values::get_properties(std::size_t pos) const 0052 { 0053 if (row_) 0054 { 0055 return row_->get_properties(pos); 0056 } 0057 0058 throw soci_error("Rowset is empty"); 0059 } 0060 0061 column_properties const& values::get_properties(std::string const& name) const 0062 { 0063 if (row_) 0064 { 0065 return row_->get_properties(name); 0066 } 0067 0068 throw soci_error("Rowset is empty"); 0069 }