8 #ifndef SOCI_UNSIGNED_TYPES_H_INCLUDED 9 #define SOCI_UNSIGNED_TYPES_H_INCLUDED 29 throw soci_error(
"Null value not allowed for this type.");
32 const base_type max = (std::numeric_limits<unsigned char>::max)();
33 const base_type min = (std::numeric_limits<unsigned char>::min)();
34 if (in < min || in > max)
36 throw soci_error(
"Value outside of allowed range.");
39 out =
static_cast<unsigned char>(in);
42 static void to_base(
unsigned char const & in,
45 out =
static_cast<base_type
>(in);
60 throw soci_error(
"Null value not allowed for this type.");
63 const long long max = (std::numeric_limits<unsigned short>::max)();
64 const long long min = (std::numeric_limits<unsigned short>::min)();
65 if (in < min || in > max)
67 throw soci_error(
"Value outside of allowed range.");
70 out =
static_cast<unsigned short>(in);
73 static void to_base(
unsigned short const & in,
76 out =
static_cast<base_type
>(in);
91 throw soci_error(
"Null value not allowed for this type.");
94 const long long max = (std::numeric_limits<unsigned int>::max)();
95 const long long min = (std::numeric_limits<unsigned int>::min)();
96 if (in < min || in > max)
98 throw soci_error(
"Value outside of allowed range.");
101 out =
static_cast<unsigned int>(in);
107 out =
static_cast<base_type
>(in);
114 #endif // SOCI_UNSIGNED_TYPES_H_INCLUDED static void from_base(base_type const &in, indicator ind, unsigned char &out)
static void from_base(base_type const &in, indicator ind, unsigned short &out)
static void to_base(unsigned char const &in, base_type &out, indicator &ind)
static void to_base(unsigned int const &in, base_type &out, indicator &ind)
static void to_base(unsigned short const &in, base_type &out, indicator &ind)
static void from_base(base_type const &in, indicator ind, unsigned int &out)