boost-fusion.h   boost-fusion.h 
skipping to change at line 27 skipping to change at line 27
// boost // boost
#include <boost/fusion/container/vector.hpp> #include <boost/fusion/container/vector.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp> #include <boost/fusion/sequence/intrinsic/at.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp> #include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/include/at.hpp> #include <boost/fusion/include/at.hpp>
#include <boost/fusion/support/is_sequence.hpp> #include <boost/fusion/support/is_sequence.hpp>
#include <boost/preprocessor/repetition/repeat.hpp> #include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp> #include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
namespace soci
{
namespace detail
{
template <typename Seq, int size>
struct type_conversion;
#define SOCI_READ_FROM_BASE(z, k, data) \
>> boost::fusion::at_c<k>(out)
/**/
#define SOCI_READ_TO_BASE(z, k, data) \
<< boost::fusion::at_c<k>(in)
/**/
#define SOCI_TYPE_CONVERSION_FUSION(z, k, data) \
template <typename Seq> \
struct type_conversion<Seq, k> \
{ \
typedef values base_type; \
\
static void from_base(base_type const & in, indicator /*ind*/, Seq
& out) \
{ \
in \
BOOST_PP_REPEAT(k, SOCI_READ_FROM_BASE, BOOST_PP_EMPTY) \
; \
} \
\
static void to_base(Seq & in, base_type & out, indicator & /*ind*/)
\
{ \
out \
BOOST_PP_REPEAT(k, SOCI_READ_TO_BASE, BOOST_PP_EMPTY) \
; \
} \
};
/**/
BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_ADD(SOCI_MAX_FUSION_SEQUENCE_LENGTH, 1)
, SOCI_TYPE_CONVERSION_FUSION, BOOST_PP_EMPTY)
#undef SOCI_TYPE_CONVERSION_FUSION
#undef SOCI_READ_FROM_BASE
#undef SOCI_READ_TO_BASE
} // namespace detail
template <typename T>
struct type_conversion<T,
typename boost::enable_if<
boost::fusion::traits::is_sequence<T>
>::type >
{
typedef values base_type;
private:
typedef typename boost::fusion::result_of::size<T>::type size;
typedef detail::type_conversion<T, size::value> converter;
public:
static void from_base(base_type const & in, indicator ind, T& out)
{
converter::from_base( in, ind, out );
}
static void to_base(T& in, base_type & out, indicator & ind)
{
converter::to_base( in, out, ind );
}
};
} // namespace soci
#endif // SOCI_BOOST_FUSION_H_INCLUDED #endif // SOCI_BOOST_FUSION_H_INCLUDED
 End of changes. 1 change blocks. 
75 lines changed or deleted 0 lines changed or added


 boost-tuple.h   boost-tuple.h 
skipping to change at line 13 skipping to change at line 13
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
#ifndef SOCI_BOOST_TUPLE_H_INCLUDED #ifndef SOCI_BOOST_TUPLE_H_INCLUDED
#define SOCI_BOOST_TUPLE_H_INCLUDED #define SOCI_BOOST_TUPLE_H_INCLUDED
#include "values.h" #include "values.h"
#include "type-conversion-traits.h" #include "type-conversion-traits.h"
// boost // boost
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#include <boost/fusion/adapted/boost_tuple.hpp>
#if defined(BOOST_VERSION) && BOOST_VERSION < 103500
namespace soci
{
template <typename T0>
struct type_conversion<boost::tuple<T0> >
{
typedef values base_type;
static void from_base(base_type const & in, indicator ind,
boost::tuple<T0> & out)
{
in
>> boost::tuples::get<0>(out);
}
static void to_base(boost::tuple<T0> & in,
base_type & out, indicator & ind)
{
out
<< boost::tuples::get<0>(in);
}
};
template <typename T0, typename T1>
struct type_conversion<boost::tuple<T0, T1> >
{
typedef values base_type;
static void from_base(base_type const & in, indicator ind,
boost::tuple<T0, T1> & out)
{
in
>> boost::tuples::get<0>(out)
>> boost::tuples::get<1>(out);
}
static void to_base(boost::tuple<T0, T1> & in,
base_type & out, indicator & ind)
{
out
<< boost::tuples::get<0>(in)
<< boost::tuples::get<1>(in);
}
};
template <typename T0, typename T1, typename T2>
struct type_conversion<boost::tuple<T0, T1, T2> >
{
typedef values base_type;
static void from_base(base_type const & in, indicator ind,
boost::tuple<T0, T1, T2> & out)
{
in
>> boost::tuples::get<0>(out)
>> boost::tuples::get<1>(out)
>> boost::tuples::get<2>(out);
}
static void to_base(boost::tuple<T0, T1, T2> & in,
base_type & out, indicator & ind)
{
out
<< boost::tuples::get<0>(in)
<< boost::tuples::get<1>(in)
<< boost::tuples::get<2>(in);
}
};
template <typename T0, typename T1, typename T2, typename T3>
struct type_conversion<boost::tuple<T0, T1, T2, T3> >
{
typedef values base_type;
static void from_base(base_type const & in, indicator ind,
boost::tuple<T0, T1, T2, T3> & out)
{
in
>> boost::tuples::get<0>(out)
>> boost::tuples::get<1>(out)
>> boost::tuples::get<2>(out)
>> boost::tuples::get<3>(out);
}
static void to_base(boost::tuple<T0, T1, T2, T3> & in,
base_type & out, indicator & ind)
{
out
<< boost::tuples::get<0>(in)
<< boost::tuples::get<1>(in)
<< boost::tuples::get<2>(in)
<< boost::tuples::get<3>(in);
}
};
template <typename T0, typename T1, typename T2, typename T3, typename T4>
struct type_conversion<boost::tuple<T0, T1, T2, T3, T4> >
{
typedef values base_type;
static void from_base(base_type const & in, indicator ind,
boost::tuple<T0, T1, T2, T3, T4> & out)
{
in
>> boost::tuples::get<0>(out)
>> boost::tuples::get<1>(out)
>> boost::tuples::get<2>(out)
>> boost::tuples::get<3>(out)
>> boost::tuples::get<4>(out);
}
static void to_base(boost::tuple<T0, T1, T2, T3, T4> & in,
base_type & out, indicator & ind)
{
out
<< boost::tuples::get<0>(in)
<< boost::tuples::get<1>(in)
<< boost::tuples::get<2>(in)
<< boost::tuples::get<3>(in)
<< boost::tuples::get<4>(in);
}
};
template <typename T0, typename T1, typename T2, typename T3, typename T4,
typename T5>
struct type_conversion<boost::tuple<T0, T1, T2, T3, T4, T5> >
{
typedef values base_type;
static void from_base(base_type const & in, indicator ind,
boost::tuple<T0, T1, T2, T3, T4, T5> & out)
{
in
>> boost::tuples::get<0>(out)
>> boost::tuples::get<1>(out)
>> boost::tuples::get<2>(out)
>> boost::tuples::get<3>(out)
>> boost::tuples::get<4>(out)
>> boost::tuples::get<5>(out);
}
static void to_base(boost::tuple<T0, T1, T2, T3, T4, T5> & in,
base_type & out, indicator & ind)
{
out
<< boost::tuples::get<0>(in)
<< boost::tuples::get<1>(in)
<< boost::tuples::get<2>(in)
<< boost::tuples::get<3>(in)
<< boost::tuples::get<4>(in)
<< boost::tuples::get<5>(in);
}
};
template <typename T0, typename T1, typename T2, typename T3, typename T4,
typename T5, typename T6>
struct type_conversion<boost::tuple<T0, T1, T2, T3, T4, T5, T6> >
{
typedef values base_type;
static void from_base(base_type const & in, indicator ind,
boost::tuple<T0, T1, T2, T3, T4, T5, T6> & out)
{
in
>> boost::tuples::get<0>(out)
>> boost::tuples::get<1>(out)
>> boost::tuples::get<2>(out)
>> boost::tuples::get<3>(out)
>> boost::tuples::get<4>(out)
>> boost::tuples::get<5>(out)
>> boost::tuples::get<6>(out);
}
static void to_base(boost::tuple<T0, T1, T2, T3, T4, T5, T6> & in,
base_type & out, indicator & ind)
{
out
<< boost::tuples::get<0>(in)
<< boost::tuples::get<1>(in)
<< boost::tuples::get<2>(in)
<< boost::tuples::get<3>(in)
<< boost::tuples::get<4>(in)
<< boost::tuples::get<5>(in)
<< boost::tuples::get<6>(in);
}
};
template <typename T0, typename T1, typename T2, typename T3, typename T4,
typename T5, typename T6, typename T7>
struct type_conversion<boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7> >
{
typedef values base_type;
static void from_base(base_type const & in, indicator ind,
boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7> & out)
{
in
>> boost::tuples::get<0>(out)
>> boost::tuples::get<1>(out)
>> boost::tuples::get<2>(out)
>> boost::tuples::get<3>(out)
>> boost::tuples::get<4>(out)
>> boost::tuples::get<5>(out)
>> boost::tuples::get<6>(out)
>> boost::tuples::get<7>(out);
}
static void to_base(boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7> & in,
base_type & out, indicator & ind)
{
out
<< boost::tuples::get<0>(in)
<< boost::tuples::get<1>(in)
<< boost::tuples::get<2>(in)
<< boost::tuples::get<3>(in)
<< boost::tuples::get<4>(in)
<< boost::tuples::get<5>(in)
<< boost::tuples::get<6>(in)
<< boost::tuples::get<7>(in);
}
};
template <typename T0, typename T1, typename T2, typename T3, typename T4,
typename T5, typename T6, typename T7, typename T8>
struct type_conversion<boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> >
{
typedef values base_type;
static void from_base(base_type const & in, indicator ind,
boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> & out)
{
in
>> boost::tuples::get<0>(out)
>> boost::tuples::get<1>(out)
>> boost::tuples::get<2>(out)
>> boost::tuples::get<3>(out)
>> boost::tuples::get<4>(out)
>> boost::tuples::get<5>(out)
>> boost::tuples::get<6>(out)
>> boost::tuples::get<7>(out)
>> boost::tuples::get<8>(out);
}
static void to_base(boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8> &
in,
base_type & out, indicator & ind)
{
out
<< boost::tuples::get<0>(in)
<< boost::tuples::get<1>(in)
<< boost::tuples::get<2>(in)
<< boost::tuples::get<3>(in)
<< boost::tuples::get<4>(in)
<< boost::tuples::get<5>(in)
<< boost::tuples::get<6>(in)
<< boost::tuples::get<7>(in)
<< boost::tuples::get<8>(in);
}
};
template <typename T0, typename T1, typename T2, typename T3, typename T4,
typename T5, typename T6, typename T7, typename T8, typename T9>
struct type_conversion<boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>
>
{
typedef values base_type;
static void from_base(base_type const & in, indicator ind,
boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & out)
{
in
>> boost::tuples::get<0>(out)
>> boost::tuples::get<1>(out)
>> boost::tuples::get<2>(out)
>> boost::tuples::get<3>(out)
>> boost::tuples::get<4>(out)
>> boost::tuples::get<5>(out)
>> boost::tuples::get<6>(out)
>> boost::tuples::get<7>(out)
>> boost::tuples::get<8>(out)
>> boost::tuples::get<9>(out);
}
static void to_base(
boost::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> & in,
base_type & out, indicator & ind)
{
out
<< boost::tuples::get<0>(in)
<< boost::tuples::get<1>(in)
<< boost::tuples::get<2>(in)
<< boost::tuples::get<3>(in)
<< boost::tuples::get<4>(in)
<< boost::tuples::get<5>(in)
<< boost::tuples::get<6>(in)
<< boost::tuples::get<7>(in)
<< boost::tuples::get<8>(in)
<< boost::tuples::get<9>(in);
}
};
} // namespace soci
#else // BOOST_VERSION >= 103500
# include "boost-fusion.h"
# include <boost/fusion/adapted/boost_tuple.hpp>
#endif
#endif // SOCI_BOOST_TUPLE_H_INCLUDED #endif // SOCI_BOOST_TUPLE_H_INCLUDED
 End of changes. 2 change blocks. 
310 lines changed or deleted 2 lines changed or added


 into.h   into.h 
skipping to change at line 25 skipping to change at line 25
#include <cstddef> #include <cstddef>
#include <vector> #include <vector>
namespace soci namespace soci
{ {
// the into function is a helper for defining output variables // the into function is a helper for defining output variables
// these helpers work with both basic and user-defined types thanks to // these helpers work with both basic and user-defined types thanks to
// the tag-dispatching, as defined in exchange_traits template // the tag-dispatching, as defined in exchange_traits template
template <typename T> namespace details
details::into_type_ptr into(T & t)
{ {
return details::do_into(t, template <typename T, typename Indicator>
typename details::exchange_traits<T>::type_family()); struct into_container
} {
into_container(T &_t, Indicator &_ind)
: t(_t), ind(_ind) {}
T &t;
Indicator &ind;
};
typedef void no_indicator;
template <typename T> template <typename T>
details::into_type_ptr into(T & t, indicator & ind) struct into_container<T, no_indicator>
{ {
return details::do_into(t, ind, into_container(T &_t)
typename details::exchange_traits<T>::type_family()); : t(_t) {}
}
T &t;
};
} // namespace details
template <typename T> template <typename T>
details::into_type_ptr into(T & t, std::vector<indicator> & ind) details::into_container<T, details::no_indicator>
{ into(T &t)
return details::do_into(t, ind, { return details::into_container<T, details::no_indicator>(t); }
typename details::exchange_traits<T>::type_family());
} template <typename T, typename Indicator>
details::into_container<T, Indicator>
into(T &t, Indicator &ind)
{ return details::into_container<T, Indicator>(t, ind); }
// for char buffer with run-time size information // for char buffer with run-time size information
template <typename T> template <typename T>
details::into_type_ptr into(T & t, std::size_t bufSize) details::into_type_ptr into(T & t, std::size_t bufSize)
{ {
return details::into_type_ptr(new details::into_type<T>(t, bufSize)); return details::into_type_ptr(new details::into_type<T>(t, bufSize));
} }
} // namespace soci } // namespace soci
 End of changes. 6 change blocks. 
14 lines changed or deleted 27 lines changed or added


 once-temp-type.h   once-temp-type.h 
skipping to change at line 49 skipping to change at line 49
~once_temp_type() SOCI_ONCE_TEMP_TYPE_NOEXCEPT; ~once_temp_type() SOCI_ONCE_TEMP_TYPE_NOEXCEPT;
template <typename T> template <typename T>
once_temp_type & operator<<(T const & t) once_temp_type & operator<<(T const & t)
{ {
rcst_->accumulate(t); rcst_->accumulate(t);
return *this; return *this;
} }
once_temp_type & operator,(into_type_ptr const &); once_temp_type & operator,(into_type_ptr const &);
once_temp_type & operator,(use_type_ptr const &); template <typename T, typename Indicator>
once_temp_type &operator,(into_container<T, Indicator> const &ic)
{
rcst_->exchange(ic);
return *this;
}
template <typename T, typename Indicator>
once_temp_type &operator,(use_container<T, Indicator> const &uc)
{
rcst_->exchange(uc);
return *this;
}
private: private:
ref_counted_statement * rcst_; ref_counted_statement * rcst_;
}; };
// this needs to be lightweight and copyable // this needs to be lightweight and copyable
class once_type class once_type
{ {
public: public:
once_type() : session_(NULL) {} once_type() : session_(NULL) {}
 End of changes. 1 change blocks. 
1 lines changed or deleted 12 lines changed or added


 prepare-temp-type.h   prepare-temp-type.h 
skipping to change at line 13 skipping to change at line 13
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
#ifndef SOCI_PREPARE_TEMP_TYPE_INCLUDED #ifndef SOCI_PREPARE_TEMP_TYPE_INCLUDED
#define SOCI_PREPARE_TEMP_TYPE_INCLUDED #define SOCI_PREPARE_TEMP_TYPE_INCLUDED
#include "into-type.h" #include "into-type.h"
#include "use-type.h" #include "use-type.h"
#include "use.h"
#include "ref-counted-prepare-info.h" #include "ref-counted-prepare-info.h"
namespace soci namespace soci
{ {
namespace details namespace details
{ {
// this needs to be lightweight and copyable // this needs to be lightweight and copyable
class SOCI_DECL prepare_temp_type class SOCI_DECL prepare_temp_type
skipping to change at line 39 skipping to change at line 40
~prepare_temp_type(); ~prepare_temp_type();
template <typename T> template <typename T>
prepare_temp_type & operator<<(T const & t) prepare_temp_type & operator<<(T const & t)
{ {
rcpi_->accumulate(t); rcpi_->accumulate(t);
return *this; return *this;
} }
prepare_temp_type & operator,(into_type_ptr const & i); prepare_temp_type & operator,(into_type_ptr const & i);
prepare_temp_type & operator,(use_type_ptr const & u);
template <typename T, typename Indicator>
prepare_temp_type &operator,(into_container<T, Indicator> const &ic)
{
rcpi_->exchange(ic);
return *this;
}
template <typename T, typename Indicator>
prepare_temp_type &operator,(use_container<T, Indicator> const &uc)
{
rcpi_->exchange(uc);
return *this;
}
ref_counted_prepare_info * get_prepare_info() const { return rcpi_; } ref_counted_prepare_info * get_prepare_info() const { return rcpi_; }
private: private:
ref_counted_prepare_info * rcpi_; ref_counted_prepare_info * rcpi_;
}; };
} // namespace details } // namespace details
} // namespace soci } // namespace soci
 End of changes. 2 change blocks. 
1 lines changed or deleted 14 lines changed or added


 ref-counted-prepare-info.h   ref-counted-prepare-info.h 
// //
// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
#ifndef SOCI_REF_COUNTED_PREPARE_INFO_INCLUDED #ifndef SOCI_REF_COUNTED_PREPARE_INFO_INCLUDED
#define SOCI_REF_COUNTED_PREPARE_INFO_INCLUDED #define SOCI_REF_COUNTED_PREPARE_INFO_INCLUDED
#include "bind-values.h"
#include "ref-counted-statement.h" #include "ref-counted-statement.h"
// std // std
#include <string> #include <string>
#include <vector> #include <vector>
namespace soci namespace soci
{ {
class session; class session;
namespace details namespace details
skipping to change at line 38 skipping to change at line 40
// this class conveys only the statement text and the bind/define info // this class conveys only the statement text and the bind/define info
// it exists only to be passed to statement's constructor // it exists only to be passed to statement's constructor
class ref_counted_prepare_info : public ref_counted_statement_base class ref_counted_prepare_info : public ref_counted_statement_base
{ {
public: public:
ref_counted_prepare_info(session& s) ref_counted_prepare_info(session& s)
: ref_counted_statement_base(s) : ref_counted_statement_base(s)
, session_(s) , session_(s)
{} {}
void exchange(into_type_ptr const& i); void exchange(use_type_ptr const& u) { uses_.exchange(u); }
void exchange(use_type_ptr const& u);
template <typename T, typename Indicator>
void exchange(use_container<T, Indicator> const &uc)
{ uses_.exchange(uc); }
void exchange(into_type_ptr const& i) { intos_.exchange(i); }
template <typename T, typename Indicator>
void exchange(into_container<T, Indicator> const &ic)
{ intos_.exchange(ic); }
void final_action(); void final_action();
private: private:
friend class statement_impl; friend class statement_impl;
friend class procedure_impl; friend class procedure_impl;
session& session_; session& session_;
std::vector<into_type_base*> intos_; into_type_vector intos_;
std::vector<use_type_base*> uses_; use_type_vector uses_;
std::string get_query() const; std::string get_query() const;
}; };
} // namespace details } // namespace details
} // namespace soci } // namespace soci
#endif #endif
 End of changes. 4 change blocks. 
4 lines changed or deleted 15 lines changed or added


 ref-counted-statement.h   ref-counted-statement.h 
skipping to change at line 78 skipping to change at line 78
}; };
// this class is supposed to be a vehicle for the "once" statements // this class is supposed to be a vehicle for the "once" statements
// it executes the whole statement in its destructor // it executes the whole statement in its destructor
class ref_counted_statement : public ref_counted_statement_base class ref_counted_statement : public ref_counted_statement_base
{ {
public: public:
ref_counted_statement(session & s) ref_counted_statement(session & s)
: ref_counted_statement_base(s), st_(s) {} : ref_counted_statement_base(s), st_(s) {}
void exchange(into_type_ptr const & i) { st_.exchange(i); }
void exchange(use_type_ptr const & u) { st_.exchange(u); }
virtual void final_action(); virtual void final_action();
template <typename T>
void exchange(T &t) { st_.exchange(t); }
private: private:
statement st_; statement st_;
}; };
} // namespace details } // namespace details
} // namespace soci } // namespace soci
#endif #endif
 End of changes. 2 change blocks. 
3 lines changed or deleted 3 lines changed or added


 soci-odbc.h   soci-odbc.h 
skipping to change at line 27 skipping to change at line 27
# endif // SOCI_ODBC_SOURCE # endif // SOCI_ODBC_SOURCE
# endif // SOCI_DLL # endif // SOCI_DLL
#endif // _WIN32 #endif // _WIN32
// //
// If SOCI_ODBC_DECL isn't defined yet define it now // If SOCI_ODBC_DECL isn't defined yet define it now
#ifndef SOCI_ODBC_DECL #ifndef SOCI_ODBC_DECL
# define SOCI_ODBC_DECL # define SOCI_ODBC_DECL
#endif #endif
#include <vector> #include <vector>
#include <sstream>
#include <soci-backend.h> #include <soci-backend.h>
#if defined(_MSC_VER) || defined(__MINGW32__) #if defined(_MSC_VER) || defined(__MINGW32__)
#include <soci-platform.h> #include <soci-platform.h>
#include <windows.h> #include <windows.h>
#endif #endif
#include <sqlext.h> // ODBC #include <sqlext.h> // ODBC
#include <string.h> // strcpy() #include <string.h> // strcpy()
namespace soci namespace soci
{ {
skipping to change at line 326 skipping to change at line 327
class SOCI_ODBC_DECL odbc_soci_error : public soci_error class SOCI_ODBC_DECL odbc_soci_error : public soci_error
{ {
SQLCHAR message_[SQL_MAX_MESSAGE_LENGTH + 1]; SQLCHAR message_[SQL_MAX_MESSAGE_LENGTH + 1];
SQLCHAR sqlstate_[SQL_SQLSTATE_SIZE + 1]; SQLCHAR sqlstate_[SQL_SQLSTATE_SIZE + 1];
SQLINTEGER sqlcode_; SQLINTEGER sqlcode_;
public: public:
odbc_soci_error(SQLSMALLINT htype, odbc_soci_error(SQLSMALLINT htype,
SQLHANDLE hndl, SQLHANDLE hndl,
std::string const & msg) std::string const & msg)
: soci_error(msg) : soci_error(interpret_odbc_error(htype, hndl, msg))
{ {
}
SQLCHAR const * odbc_error_code() const
{
return sqlstate_;
}
SQLINTEGER native_error_code() const
{
return sqlcode_;
}
SQLCHAR const * odbc_error_message() const
{
return message_;
}
private:
std::string interpret_odbc_error(SQLSMALLINT htype, SQLHANDLE hndl, std
::string const& msg)
{
std::ostringstream ss(msg, std::ostringstream::app);
const char* socierror = NULL; const char* socierror = NULL;
SQLSMALLINT length, i = 1; SQLSMALLINT length, i = 1;
switch ( SQLGetDiagRecA(htype, hndl, i, sqlstate_, &sqlcode_, switch ( SQLGetDiagRecA(htype, hndl, i, sqlstate_, &sqlcode_,
message_, SQL_MAX_MESSAGE_LENGTH + 1, message_, SQL_MAX_MESSAGE_LENGTH + 1,
&length) ) &length) )
{ {
case SQL_SUCCESS: case SQL_SUCCESS:
// The error message was successfully retrieved. // The error message was successfully retrieved.
break; break;
skipping to change at line 370 skipping to change at line 390
if (socierror) if (socierror)
{ {
// Use our own error message if we failed to retrieve the ODBC one. // Use our own error message if we failed to retrieve the ODBC one.
strcpy(reinterpret_cast<char*>(message_), socierror); strcpy(reinterpret_cast<char*>(message_), socierror);
// Use "General warning" SQLSTATE code. // Use "General warning" SQLSTATE code.
strcpy(reinterpret_cast<char*>(sqlstate_), "01000"); strcpy(reinterpret_cast<char*>(sqlstate_), "01000");
sqlcode_ = 0; sqlcode_ = 0;
} }
}
SQLCHAR const * odbc_error_code() const ss << ": " << message_ << " (" << sqlstate_ << ")";
{
return reinterpret_cast<SQLCHAR const *>(sqlstate_); return ss.str();
}
SQLINTEGER native_error_code() const
{
return sqlcode_;
}
SQLCHAR const * odbc_error_message() const
{
return reinterpret_cast<SQLCHAR const *>(message_);
} }
}; };
inline bool is_odbc_error(SQLRETURN rc) inline bool is_odbc_error(SQLRETURN rc)
{ {
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO && rc != SQL_NO_DA TA) if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO && rc != SQL_NO_DA TA)
{ {
return true; return true;
} }
else else
 End of changes. 5 change blocks. 
13 lines changed or deleted 25 lines changed or added


 soci-platform.h   soci-platform.h 
skipping to change at line 23 skipping to change at line 23
#else #else
#define LL_FMT_FLAGS "ll" #define LL_FMT_FLAGS "ll"
#endif #endif
// Portability hacks for Microsoft Visual C++ compiler // Portability hacks for Microsoft Visual C++ compiler
#ifdef _MSC_VER #ifdef _MSC_VER
#include <stdlib.h> #include <stdlib.h>
// Define if you have the vsnprintf variants. // Define if you have the vsnprintf variants.
#if _MSC_VER < 1500 #if _MSC_VER < 1500
# define HAVE_VSNPRINTF 1
# define vsnprintf _vsnprintf # define vsnprintf _vsnprintf
#endif #endif
// Define if you have the snprintf variants. // Define if you have the snprintf variants.
#define HAVE_SNPRINTF 1
#define snprintf _snprintf #define snprintf _snprintf
// Define if you have the strtoll and strtoull variants. // Define if you have the strtoll and strtoull variants.
#if _MSC_VER >= 1300 #if _MSC_VER < 1300
# define HAVE_STRTOLL 1 # error "Visual C++ versions prior 1300 don't support _strtoi64 and _strtou
# define HAVE_STRTOULL 1 i64"
#elif _MSC_VER >= 1300 && _MSC_VER < 1800
namespace std { namespace std {
inline long long strtoll(char const* str, char** str_end, int base) inline long long strtoll(char const* str, char** str_end, int base)
{ {
return _strtoi64(str, str_end, base); return _strtoi64(str, str_end, base);
} }
inline unsigned long long strtoull(char const* str, char** str_end, int base) inline unsigned long long strtoull(char const* str, char** str_end, int base)
{ {
return _strtoui64(str, str_end, base); return _strtoui64(str, str_end, base);
} }
} }
#else #endif // _MSC_VER < 1800
# undef HAVE_STRTOLL
# undef HAVE_STRTOULL
# error "Visual C++ versions prior 1300 don't support _strtoi64 and _strtou
i64"
#endif // _MSC_VER >= 1300
#endif // _MSC_VER #endif // _MSC_VER
#if defined(__CYGWIN__) || defined(__MINGW32__)
#include <stdlib.h>
namespace std {
using ::strtoll;
using ::strtoull;
}
#endif
#endif // SOCI_PLATFORM_H_INCLUDED #endif // SOCI_PLATFORM_H_INCLUDED
 End of changes. 5 change blocks. 
11 lines changed or deleted 13 lines changed or added


 soci-sqlite3.h   soci-sqlite3.h 
skipping to change at line 59 skipping to change at line 59
#undef SQLITE_STATIC #undef SQLITE_STATIC
#define SQLITE_STATIC ((sqlite_api::sqlite3_destructor_type)0) #define SQLITE_STATIC ((sqlite_api::sqlite3_destructor_type)0)
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#endif #endif
namespace soci namespace soci
{ {
class sqlite3_soci_error : public soci_error
{
public:
sqlite3_soci_error(std::string const & msg, int result);
int result() const;
private:
int result_;
};
struct sqlite3_statement_backend; struct sqlite3_statement_backend;
struct sqlite3_standard_into_type_backend : details::standard_into_type_bac kend struct sqlite3_standard_into_type_backend : details::standard_into_type_bac kend
{ {
sqlite3_standard_into_type_backend(sqlite3_statement_backend &st) sqlite3_standard_into_type_backend(sqlite3_statement_backend &st)
: statement_(st) {} : statement_(st) {}
virtual void define_by_pos(int &position, virtual void define_by_pos(int &position,
void *data, details::exchange_type type); void *data, details::exchange_type type);
virtual void pre_fetch(); virtual void pre_fetch();
 End of changes. 1 change blocks. 
0 lines changed or deleted 11 lines changed or added


 statement.h   statement.h 
// //
// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
#ifndef SOCI_STATEMENT_H_INCLUDED #ifndef SOCI_STATEMENT_H_INCLUDED
#define SOCI_STATEMENT_H_INCLUDED #define SOCI_STATEMENT_H_INCLUDED
#include "bind-values.h"
#include "into-type.h" #include "into-type.h"
#include "into.h" #include "into.h"
#include "use-type.h" #include "use-type.h"
#include "use.h"
#include "soci-backend.h" #include "soci-backend.h"
#include "row.h" #include "row.h"
// std // std
#include <cstddef> #include <cstddef>
#include <string> #include <string>
#include <map> #include <map>
#include <vector> #include <vector>
namespace soci namespace soci
{ {
skipping to change at line 44 skipping to change at line 46
class SOCI_DECL statement_impl class SOCI_DECL statement_impl
{ {
public: public:
explicit statement_impl(session & s); explicit statement_impl(session & s);
explicit statement_impl(prepare_temp_type const & prep); explicit statement_impl(prepare_temp_type const & prep);
~statement_impl(); ~statement_impl();
void alloc(); void alloc();
void bind(values & v); void bind(values & v);
void exchange(into_type_ptr const & i);
void exchange(use_type_ptr const & u); void exchange(into_type_ptr const & i) { intos_.exchange(i); }
template <typename T, typename Indicator>
void exchange(into_container<T, Indicator> const &ic)
{ intos_.exchange(ic); }
void exchange(use_type_ptr const & u) { uses_.exchange(u); }
template <typename T, typename Indicator>
void exchange(use_container<T, Indicator> const &uc)
{ uses_.exchange(uc); }
void clean_up(); void clean_up();
void prepare(std::string const & query, void prepare(std::string const & query,
statement_type eType = st_repeatable_query); statement_type eType = st_repeatable_query);
void define_and_bind(); void define_and_bind();
void undefine_and_bind(); void undefine_and_bind();
bool execute(bool withDataExchange = false); bool execute(bool withDataExchange = false);
long long get_affected_rows(); long long get_affected_rows();
bool fetch(); bool fetch();
void describe(); void describe();
void set_row(row * r); void set_row(row * r);
void exchange_for_rowset(into_type_ptr const & i); void exchange_for_rowset(into_type_ptr const & i) { exchange_for_rowset
_(i); }
template<typename T, typename Indicator>
void exchange_for_rowset(into_container<T, Indicator> const &ic)
{ exchange_for_rowset_(ic); }
// for diagnostics and advanced users // for diagnostics and advanced users
// (downcast it to expected back-end statement class) // (downcast it to expected back-end statement class)
statement_backend * get_backend() { return backEnd_; } statement_backend * get_backend() { return backEnd_; }
standard_into_type_backend * make_into_type_backend(); standard_into_type_backend * make_into_type_backend();
standard_use_type_backend * make_use_type_backend(); standard_use_type_backend * make_use_type_backend();
vector_into_type_backend * make_vector_into_type_backend(); vector_into_type_backend * make_vector_into_type_backend();
vector_use_type_backend * make_vector_use_type_backend(); vector_use_type_backend * make_vector_use_type_backend();
void inc_ref(); void inc_ref();
void dec_ref(); void dec_ref();
session & session_; session & session_;
std::string rewrite_for_procedure_call(std::string const & query); std::string rewrite_for_procedure_call(std::string const & query);
protected: protected:
std::vector<details::into_type_base *> intos_; into_type_vector intos_;
std::vector<details::use_type_base *> uses_; use_type_vector uses_;
std::vector<indicator *> indicators_; std::vector<indicator *> indicators_;
private: private:
int refCount_; int refCount_;
row * row_; row * row_;
std::size_t fetchSize_; std::size_t fetchSize_;
std::size_t initialFetchSize_; std::size_t initialFetchSize_;
std::string query_; std::string query_;
std::map<std::string, use_type_base *> namedUses_; std::map<std::string, use_type_base *> namedUses_;
std::vector<into_type_base *> intosForRow_; into_type_vector intosForRow_;
int definePositionForRow_; int definePositionForRow_;
void exchange_for_row(into_type_ptr const & i); template <typename Into>
void exchange_for_rowset_(Into const &i)
{
if (intos_.empty() == false)
{
throw soci_error("Explicit into elements not allowed with rowse
t.");
}
intos_.exchange(i);
int definePosition = 1;
for(into_type_vector::iterator iter = intos_.begin(),
end = intos_.end();
iter != end; iter++)
{ (*iter)->define(*this, definePosition); }
definePositionForRow_ = definePosition;
}
template <typename T, typename Indicator>
void exchange_for_row(into_container<T, Indicator> const &ic)
{ intosForRow_.exchange(ic); }
void exchange_for_row(into_type_ptr const & i) { intosForRow_.exchange(
i); }
void define_for_row(); void define_for_row();
template<typename T> template<typename T>
void into_row() void into_row()
{ {
T * t = new T(); T * t = new T();
indicator * ind = new indicator(i_ok); indicator * ind = new indicator(i_ok);
row_->add_holder(t, ind); row_->add_holder(t, ind);
exchange_for_row(into(*t, *ind)); exchange_for_row(into(*t, *ind));
} }
skipping to change at line 156 skipping to change at line 191
void operator=(statement const & other) void operator=(statement const & other)
{ {
other.impl_->inc_ref(); other.impl_->inc_ref();
impl_->dec_ref(); impl_->dec_ref();
impl_ = other.impl_; impl_ = other.impl_;
} }
void alloc() { impl_->alloc(); } void alloc() { impl_->alloc(); }
void bind(values & v) { impl_->bind(v); } void bind(values & v) { impl_->bind(v); }
void exchange(details::into_type_ptr const & i); void exchange(details::into_type_ptr const & i) { impl_->exchange(i); }
void exchange(details::use_type_ptr const & u); template <typename T, typename Indicator>
void exchange(details::into_container<T, Indicator> const &ic) { impl_
->exchange(ic); }
void exchange(details::use_type_ptr const & u) { impl_->exchange(u); }
template <typename T, typename Indicator>
void exchange(details::use_container<T, Indicator> const &uc) { impl_-
>exchange(uc); }
void clean_up() { impl_->clean_up(); } void clean_up() { impl_->clean_up(); }
void prepare(std::string const & query, void prepare(std::string const & query,
details::statement_type eType = details::st_repeatable_query) details::statement_type eType = details::st_repeatable_query)
{ {
impl_->prepare(query, eType); impl_->prepare(query, eType);
} }
void define_and_bind() { impl_->define_and_bind(); } void define_and_bind() { impl_->define_and_bind(); }
void undefine_and_bind() { impl_->undefine_and_bind(); } void undefine_and_bind() { impl_->undefine_and_bind(); }
skipping to change at line 189 skipping to change at line 228
bool fetch() bool fetch()
{ {
gotData_ = impl_->fetch(); gotData_ = impl_->fetch();
return gotData_; return gotData_;
} }
bool got_data() const { return gotData_; } bool got_data() const { return gotData_; }
void describe() { impl_->describe(); } void describe() { impl_->describe(); }
void set_row(row * r) { impl_->set_row(r); } void set_row(row * r) { impl_->set_row(r); }
template <typename T, typename Indicator>
void exchange_for_rowset(details::into_container<T, Indicator> const &
ic)
{
impl_->exchange_for_rowset(ic);
}
void exchange_for_rowset(details::into_type_ptr const & i) void exchange_for_rowset(details::into_type_ptr const & i)
{ {
impl_->exchange_for_rowset(i); impl_->exchange_for_rowset(i);
} }
// for diagnostics and advanced users // for diagnostics and advanced users
// (downcast it to expected back-end statement class) // (downcast it to expected back-end statement class)
details::statement_backend * get_backend() details::statement_backend * get_backend()
{ {
return impl_->get_backend(); return impl_->get_backend();
 End of changes. 9 change blocks. 
9 lines changed or deleted 61 lines changed or added


 use.h   use.h 
// //
// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at // (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
// //
#ifndef SOCI_USE_H_INCLUDED #ifndef SOCI_USE_H_INCLUDED
#define SOCI_USE_H_INCLUDED #define SOCI_USE_H_INCLUDED
#include "use-type.h" #include "soci-backend.h"
#include "exchange-traits.h"
#include "type-conversion.h"
namespace soci namespace soci
{ {
// the use function is a helper for defining input variables namespace details
// these helpers work with both basic and user-defined types thanks to {
// the tag-dispatching, as defined in exchange_traits template template <typename T, typename Indicator>
struct use_container
template <typename T>
details::use_type_ptr use(T & t, std::string const & name = std::string())
{ {
return details::do_use(t, name, use_container(T &_t, Indicator &_ind, const std::string &_name)
typename details::exchange_traits<T>::type_family()); : t(_t), ind(_ind), name(_name) {}
}
T &t;
Indicator &ind;
const std::string &name;
};
typedef void no_indicator;
template <typename T> template <typename T>
details::use_type_ptr use(T const & t, struct use_container<T, no_indicator>
std::string const & name = std::string())
{ {
return details::do_use(t, name, use_container(T &_t, const std::string &_name)
typename details::exchange_traits<T>::type_family()); : t(_t), name(_name) {}
}
T &t;
const std::string &name;
};
} // namespace details
template <typename T> template <typename T>
details::use_type_ptr use(T & t, indicator & ind, details::use_container<T, details::no_indicator> use(T &t, const std::strin
std::string const &name = std::string()) g &name = std::string())
{ { return details::use_container<T, details::no_indicator>(t, name); }
return details::do_use(t, ind, name,
typename details::exchange_traits<T>::type_family());
}
template <typename T> template <typename T>
details::use_type_ptr use(T const & t, indicator & ind, details::use_container<const T, details::no_indicator> use(T const &t, cons
std::string const &name = std::string()) t std::string &name = std::string())
{ { return details::use_container<const T, details::no_indicator>(t, name); }
return details::do_use(t, ind, name,
typename details::exchange_traits<T>::type_family());
}
template <typename T> template <typename T>
details::use_type_ptr use(T & t, std::vector<indicator> & ind, details::use_container<T, indicator> use(T &t, indicator & ind, std::string
std::string const & name = std::string()) const &name = std::string())
{ { return details::use_container<T, indicator>(t, ind, name); }
return details::do_use(t, ind, name,
typename details::exchange_traits<T>::type_family());
}
template <typename T> template <typename T>
details::use_type_ptr use(T const & t, std::vector<indicator> & ind, details::use_container<const T, indicator> use(T const &t, indicator & ind,
std::string const & name = std::string()) std::string const &name = std::string())
{ { return details::use_container<const T, indicator>(t, ind, name); }
return details::do_use(t, ind, name,
typename details::exchange_traits<T>::type_family());
}
// for char buffer with run-time size information // vector containers
template <typename T> template <typename T>
details::use_type_ptr use(T & t, std::size_t bufSize, details::use_container<T, std::vector<indicator> >
std::string const & name = std::string()) use(T &t, std::vector<indicator> & ind, const std::string &name = std::
{ string())
return details::use_type_ptr(new details::use_type<T>(t, bufSize)); { return details::use_container<T, std::vector<indicator> >(t, ind, name);
} }
// for char buffer with run-time size information
template <typename T> template <typename T>
details::use_type_ptr use(T const & t, std::size_t bufSize, details::use_container<std::vector<T>, details::no_indicator >
std::string const & name = std::string()) use(std::vector<T> &t, const std::string &name = std::string())
{ { return details::use_container<std::vector<T>, details::no_indicator>(t, n
return details::use_type_ptr(new details::use_type<T>(t, bufSize)); ame); }
}
} // namespace soci } // namespace soci
#endif // SOCI_USE_H_INCLUDED #endif // SOCI_USE_H_INCLUDED
 End of changes. 14 change blocks. 
53 lines changed or deleted 44 lines changed or added


 version.h   version.h 
skipping to change at line 23 skipping to change at line 23
// //
// Caution, this is the only SOCI header that is guarenteed // Caution, this is the only SOCI header that is guarenteed
// to change with every SOCI release, including this header // to change with every SOCI release, including this header
// will cause a recompile every time a new SOCI version is // will cause a recompile every time a new SOCI version is
// released. // released.
// //
// SOCI_VERSION % 100 is the patch level // SOCI_VERSION % 100 is the patch level
// SOCI_VERSION / 100 % 1000 is the minor version // SOCI_VERSION / 100 % 1000 is the minor version
// SOCI_VERSION / 100000 is the major version // SOCI_VERSION / 100000 is the major version
#define SOCI_VERSION 300201 #define SOCI_VERSION 300203
// //
// SOCI_LIB_VERSION must be defined to be the same as SOCI_VERSION // SOCI_LIB_VERSION must be defined to be the same as SOCI_VERSION
// but as a *string* in the form "x_y[_z]" where x is the major version // but as a *string* in the form "x_y[_z]" where x is the major version
// number, y is the minor version number, and z is the patch level if not 0. // number, y is the minor version number, and z is the patch level if not 0.
#define SOCI_LIB_VERSION "3_2_2" #define SOCI_LIB_VERSION "3_2_3"
#endif // SOCI_VERSION_HPP #endif // SOCI_VERSION_HPP
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/