1 #ifndef BLUB_STRING_HPP
2 #define BLUB_STRING_HPP
4 #include "blub/core/globals.hpp"
5 #include "blub/serialization/access.hpp"
9 #include <boost/lexical_cast.hpp>
10 #include <boost/serialization/binary_object.hpp>
13 # include <soci-backend.h>
14 # include <type-conversion.h>
25 typedef std::string t_base;
33 string(
const char* str, uint32 len)
41 template<
typename numberType>
42 static string number(
const numberType& n)
44 return boost::lexical_cast<
string>(n);
48 BLUB_SERIALIZATION_ACCESS
49 template<
typename Archive>
50 void serialize(Archive & readWrite,
const unsigned int version)
54 readWrite & BOOST_SERIALIZATION_BASE_OBJECT_NVP(t_base);
65 std::ostream& operator << (std::ostream& ostr,
const blub::string& toCast);
75 struct type_conversion<
blub::string>
77 typedef std::string base_type;
79 static void from_base(std::string i, soci::indicator ind,
blub::string & mi)
83 throw soci_error(
"Null value not allowed for this type");
89 static void to_base(
const blub::string & mi, std::string & i, indicator & ind)
91 i =
static_cast<std::string
>(mi);
102 #endif // BLUB_STRING_HPP
Definition: string.hpp:22
Definition: byteArray.hpp:17
Definition: deadlineTimer.hpp:10