1 #ifndef __DBICOLUMN_HPP_ 2 #define __DBICOLUMN_HPP_ 8 #include <boost/lexical_cast.hpp> 42 if (!
fValue)
return std::string(
"");
43 else return std::string(
fValue); }
58 fValue =
new char[v.length()+1];
67 fValue =
new char[strlen(v)+1];
72 bool Get(T& val)
const {
75 val = boost::lexical_cast<T>(std::string(
fValue));
77 catch (boost::bad_lexical_cast &) {
78 std::cerr <<
"Column::Get(): Bad_lexical_cast! Value = " 89 bool Set(
const T& val,
bool ignoreAutoIncr=
false) {
91 std::cerr <<
"Cannot set a column of type \"autoincr\"!" 100 std::string tstr = boost::lexical_cast<std::string>(val);
101 if (tstr ==
"" || tstr==
"NULL") {
106 if (tstr ==
"TRUE" || tstr ==
"t" || tstr ==
"true" ||
107 tstr ==
"y" || tstr ==
"yes" || tstr ==
"1" || tstr ==
"on")
114 fValue =
new char[tstr.length()];
115 strcpy(
fValue,tstr.c_str());
119 catch (boost::bad_lexical_cast &) {
120 std::cerr <<
"Column::Set(): Bad lexical cast! Value = " 167 if (needsQuotes) stream <<
"\'";
169 if (needsQuotes) stream <<
"\'";