common.h   common.h 
skipping to change at line 30 skipping to change at line 30
namespace details namespace details
{ {
namespace mysql namespace mysql
{ {
// helper function for parsing datetime values // helper function for parsing datetime values
void parse_std_tm(char const *buf, std::tm &t); void parse_std_tm(char const *buf, std::tm &t);
// The idea is that infinity - infinity gives NaN, and NaN != NaN is true.
//
// This should work on any IEEE-754-compliant implementation, which is
// another way of saying that it does not always work (in particular,
// according to stackoverflow, it won't work with gcc with the --fast-math
// option), but I know of no better way of testing this portably in C++ pri
or
// to C++11. When soci moves to C++11 this should be replaced
// with std::isfinite().
template <typename T>
bool is_infinity_or_nan(T x)
{
T y = x - x;
return (y != y);
}
template <typename T> template <typename T>
void parse_num(char const *buf, T &x) void parse_num(char const *buf, T &x)
{ {
std::istringstream iss(buf); std::istringstream iss(buf);
iss >> x; iss >> x;
if (iss.fail() || (iss.eof() == false)) if (iss.fail() || (iss.eof() == false))
{ {
throw soci_error("Cannot convert data."); throw soci_error("Cannot convert data.");
} }
if (is_infinity_or_nan(x)) {
throw soci_error("Cannot convert data.");
}
} }
// helper for escaping strings // helper for escaping strings
char * quote(MYSQL * conn, const char *s, int len); char * quote(MYSQL * conn, const char *s, int len);
// helper for vector operations // helper for vector operations
template <typename T> template <typename T>
std::size_t get_vector_size(void *p) std::size_t get_vector_size(void *p)
{ {
std::vector<T> *v = static_cast<std::vector<T> *>(p); std::vector<T> *v = static_cast<std::vector<T> *>(p);
 End of changes. 2 change blocks. 
0 lines changed or deleted 19 lines changed or added


 exchange-traits.h   exchange-traits.h 
skipping to change at line 52 skipping to change at line 52
}; };
template <> template <>
struct exchange_traits<short> struct exchange_traits<short>
{ {
typedef basic_type_tag type_family; typedef basic_type_tag type_family;
enum { x_type = x_short }; enum { x_type = x_short };
}; };
template <> template <>
struct exchange_traits<unsigned short> : exchange_traits<short>
{
};
template <>
struct exchange_traits<int> struct exchange_traits<int>
{ {
typedef basic_type_tag type_family; typedef basic_type_tag type_family;
enum { x_type = x_integer }; enum { x_type = x_integer };
}; };
template <> template <>
struct exchange_traits<char> struct exchange_traits<unsigned int> : exchange_traits<int>
{ {
typedef basic_type_tag type_family;
enum { x_type = x_char };
}; };
template <> template <>
struct exchange_traits<unsigned long> struct exchange_traits<char>
{ {
typedef basic_type_tag type_family; typedef basic_type_tag type_family;
enum { x_type = x_unsigned_long }; enum { x_type = x_char };
}; };
template <> template <>
struct exchange_traits<long long> struct exchange_traits<long long>
{ {
typedef basic_type_tag type_family; typedef basic_type_tag type_family;
enum { x_type = x_long_long }; enum { x_type = x_long_long };
}; };
template <> template <>
struct exchange_traits<unsigned long long> struct exchange_traits<unsigned long long>
{ {
typedef basic_type_tag type_family; typedef basic_type_tag type_family;
enum { x_type = x_unsigned_long_long }; enum { x_type = x_unsigned_long_long };
}; };
#if defined (__LP64__) || ( __WORDSIZE == 64 ) // long must be mapped either to x_integer or x_long_long:
template<int long_size> struct long_traits_helper;
template<> struct long_traits_helper<4> { enum { x_type = x_integer }; };
template<> struct long_traits_helper<8> { enum { x_type = x_long_long }; };
template <> template <>
struct exchange_traits<long int> struct exchange_traits<long int>
{ {
typedef basic_type_tag type_family; typedef basic_type_tag type_family;
enum { x_type = x_long_long }; enum { x_type = long_traits_helper<sizeof(long int)>::x_type };
};
template <>
struct exchange_traits<unsigned long> : exchange_traits<long>
{
}; };
#endif // #if defined (__LP64__) || ( __WORDSIZE == 64 )
template <> template <>
struct exchange_traits<double> struct exchange_traits<double>
{ {
typedef basic_type_tag type_family; typedef basic_type_tag type_family;
enum { x_type = x_double }; enum { x_type = x_double };
}; };
template <> template <>
struct exchange_traits<std::string> struct exchange_traits<std::string>
 End of changes. 8 change blocks. 
8 lines changed or deleted 19 lines changed or added


 session.h   session.h 
skipping to change at line 12 skipping to change at line 12
// 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_SESSION_H_INCLUDED #ifndef SOCI_SESSION_H_INCLUDED
#define SOCI_SESSION_H_INCLUDED #define SOCI_SESSION_H_INCLUDED
#include "once-temp-type.h" #include "once-temp-type.h"
#include "query_transformation.h"
#include "connection-parameters.h"
// std // std
#include <cstddef> #include <cstddef>
#include <ostream> #include <ostream>
#include <sstream> #include <sstream>
#include <string> #include <string>
namespace soci namespace soci
{ {
class values; class values;
struct backend_factory; class backend_factory;
namespace details namespace details
{ {
class session_backend; class session_backend;
class statement_backend; class statement_backend;
class rowid_backend; class rowid_backend;
class blob_backend; class blob_backend;
} // namespace details } // namespace details
class connection_pool; class connection_pool;
class SOCI_DECL session class SOCI_DECL session
{ {
public: public:
session(); session();
explicit session(connection_parameters const & parameters);
session(backend_factory const & factory, std::string const & connectStr ing); session(backend_factory const & factory, std::string const & connectStr ing);
session(std::string const & backendName, std::string const & connectStr ing); session(std::string const & backendName, std::string const & connectStr ing);
explicit session(std::string const & connectString); explicit session(std::string const & connectString);
explicit session(connection_pool & pool); explicit session(connection_pool & pool);
~session(); ~session();
void open(connection_parameters const & parameters);
void open(backend_factory const & factory, std::string const & connectS tring); void open(backend_factory const & factory, std::string const & connectS tring);
void open(std::string const & backendName, std::string const & connectS tring); void open(std::string const & backendName, std::string const & connectS tring);
void open(std::string const & connectString); void open(std::string const & connectString);
void close(); void close();
void reconnect(); void reconnect();
void begin(); void begin();
void commit(); void commit();
void rollback(); void rollback();
// once and prepare are for syntax sugar only // once and prepare are for syntax sugar only
details::once_type once; details::once_type once;
details::prepare_type prepare; details::prepare_type prepare;
// even more sugar // even more sugar
template <typename T> template <typename T>
details::once_temp_type operator<<(T const & t) { return once << t; } details::once_temp_type operator<<(T const & t) { return once << t; }
std::ostringstream & get_query_stream(); std::ostringstream & get_query_stream();
std::string get_query() const;
template <typename T>
void set_query_transformation(T callback)
{
delete query_transformation_;
query_transformation_= new details::query_transformation<T>(callbac
k);
}
// support for basic logging // support for basic logging
void set_log_stream(std::ostream * s); void set_log_stream(std::ostream * s);
std::ostream * get_log_stream() const; std::ostream * get_log_stream() const;
void log_query(std::string const & query); void log_query(std::string const & query);
std::string get_last_query() const; std::string get_last_query() const;
void set_got_data(bool gotData); void set_got_data(bool gotData);
bool got_data() const; bool got_data() const;
void uppercase_column_names(bool forceToUpper); void uppercase_column_names(bool forceToUpper);
bool get_uppercase_column_names() const; bool get_uppercase_column_names() const;
// Functions for dealing with sequence/auto-increment values.
// If true is returned, value is filled with the next value from the gi
ven
// sequence. Otherwise either the sequence is invalid (doesn't exist) o
r
// the current backend doesn't support sequences. If you use sequences
for
// automatically generating primary key values, you should use
// get_last_insert_id() after the insertion in this case.
bool get_next_sequence_value(std::string const & sequence, long & value
);
// If true is returned, value is filled with the last auto-generated va
lue
// for this table (although some backends ignore the table argument and
// return the last value auto-generated in this session).
bool get_last_insert_id(std::string const & table, long & value);
// for diagnostics and advanced users // for diagnostics and advanced users
// (downcast it to expected back-end session class) // (downcast it to expected back-end session class)
details::session_backend * get_backend() { return backEnd_; } details::session_backend * get_backend() { return backEnd_; }
std::string get_backend_name() const; std::string get_backend_name() const;
details::statement_backend * make_statement_backend(); details::statement_backend * make_statement_backend();
details::rowid_backend * make_rowid_backend(); details::rowid_backend * make_rowid_backend();
details::blob_backend * make_blob_backend(); details::blob_backend * make_blob_backend();
private: private:
session(session const &); session(session const &);
session& operator=(session const &); session& operator=(session const &);
std::ostringstream query_stream_; std::ostringstream query_stream_;
details::query_transformation_function* query_transformation_;
std::ostream * logStream_; std::ostream * logStream_;
std::string lastQuery_; std::string lastQuery_;
backend_factory const * lastFactory_; connection_parameters lastConnectParameters_;
std::string lastConnectString_;
bool uppercaseColumnNames_; bool uppercaseColumnNames_;
details::session_backend * backEnd_; details::session_backend * backEnd_;
bool gotData_; bool gotData_;
bool isFromPool_; bool isFromPool_;
std::size_t poolPosition_; std::size_t poolPosition_;
connection_pool * pool_; connection_pool * pool_;
 End of changes. 8 change blocks. 
3 lines changed or deleted 36 lines changed or added


 soci-backend.h   soci-backend.h 
skipping to change at line 24 skipping to change at line 24
#include <cstddef> #include <cstddef>
#include <map> #include <map>
#include <string> #include <string>
namespace soci namespace soci
{ {
// data types, as seen by the user // data types, as seen by the user
enum data_type enum data_type
{ {
dt_string, dt_date, dt_double, dt_integer, dt_unsigned_long, dt_long_lo ng, dt_unsigned_long_long dt_string, dt_date, dt_double, dt_integer, dt_long_long, dt_unsigned_lo ng_long
}; };
// the enum type for indicator variables // the enum type for indicator variables
enum indicator { i_ok, i_null, i_truncated }; enum indicator { i_ok, i_null, i_truncated };
class session;
namespace details namespace details
{ {
// data types, as used to describe exchange format // data types, as used to describe exchange format
enum exchange_type enum exchange_type
{ {
x_char, x_stdstring, x_char,
x_short, x_integer, x_stdstring,
x_unsigned_long, x_long_long, x_unsigned_long_long, x_short,
x_double, x_stdtm, x_statement, x_integer,
x_rowid, x_blob x_long_long,
x_unsigned_long_long,
x_double,
x_stdtm,
x_statement,
x_rowid,
x_blob
}; };
// type of statement (used for optimizing statement preparation) // type of statement (used for optimizing statement preparation)
enum statement_type enum statement_type
{ {
st_one_time_query, st_one_time_query,
st_repeatable_query st_repeatable_query
}; };
// polymorphic into type backend // polymorphic into type backend
skipping to change at line 224 skipping to change at line 232
class session_backend class session_backend
{ {
public: public:
session_backend() {} session_backend() {}
virtual ~session_backend() {} virtual ~session_backend() {}
virtual void begin() = 0; virtual void begin() = 0;
virtual void commit() = 0; virtual void commit() = 0;
virtual void rollback() = 0; virtual void rollback() = 0;
// At least one of these functions is usually not implemented for any g
iven
// backend as RDBMS support either sequences or auto-generated values,
so
// we don't declare them as pure virtuals to avoid having to define tri
vial
// versions of them in the derived classes. However every backend shoul
d
// define at least one of them to allow the code using auto-generated v
alues
// to work.
virtual bool get_next_sequence_value(session&, std::string const&, long
&)
{
return false;
}
virtual bool get_last_insert_id(session&, std::string const&, long&)
{
return false;
}
virtual std::string get_backend_name() const = 0; virtual std::string get_backend_name() const = 0;
virtual statement_backend* make_statement_backend() = 0; virtual statement_backend* make_statement_backend() = 0;
virtual rowid_backend* make_rowid_backend() = 0; virtual rowid_backend* make_rowid_backend() = 0;
virtual blob_backend* make_blob_backend() = 0; virtual blob_backend* make_blob_backend() = 0;
private: private:
// noncopyable // noncopyable
session_backend(session_backend const&); session_backend(session_backend const&);
session_backend& operator=(session_backend const&); session_backend& operator=(session_backend const&);
}; };
} // namespace details } // namespace details
// simple base class for the session back-end factory // simple base class for the session back-end factory
struct SOCI_DECL backend_factory class connection_parameters;
class SOCI_DECL backend_factory
{ {
backend_factory() {} public:
backend_factory() {}
virtual ~backend_factory() {} virtual ~backend_factory() {}
virtual details::session_backend* make_session( virtual details::session_backend* make_session(
std::string const& connectString) const = 0; connection_parameters const& parameters) const = 0;
}; };
} // namespace soci } // namespace soci
#endif // SOCI_BACKEND_H_INCLUDED #endif // SOCI_BACKEND_H_INCLUDED
 End of changes. 7 change blocks. 
9 lines changed or deleted 41 lines changed or added


 soci-empty.h   soci-empty.h 
skipping to change at line 157 skipping to change at line 157
std::size_t read(std::size_t offset, char* buf, std::size_t toRead); std::size_t read(std::size_t offset, char* buf, std::size_t toRead);
std::size_t write(std::size_t offset, char const* buf, std::size_t toWr ite); std::size_t write(std::size_t offset, char const* buf, std::size_t toWr ite);
std::size_t append(char const* buf, std::size_t toWrite); std::size_t append(char const* buf, std::size_t toWrite);
void trim(std::size_t newLen); void trim(std::size_t newLen);
empty_session_backend& session_; empty_session_backend& session_;
}; };
struct empty_session_backend : details::session_backend struct empty_session_backend : details::session_backend
{ {
empty_session_backend(std::string const& connectString); empty_session_backend(connection_parameters const& parameters);
~empty_session_backend(); ~empty_session_backend();
void begin(); void begin();
void commit(); void commit();
void rollback(); void rollback();
std::string get_backend_name() const { return "empty"; } std::string get_backend_name() const { return "empty"; }
void clean_up(); void clean_up();
empty_statement_backend* make_statement_backend(); empty_statement_backend* make_statement_backend();
empty_rowid_backend* make_rowid_backend(); empty_rowid_backend* make_rowid_backend();
empty_blob_backend* make_blob_backend(); empty_blob_backend* make_blob_backend();
}; };
struct SOCI_EMPTY_DECL empty_backend_factory : backend_factory struct SOCI_EMPTY_DECL empty_backend_factory : backend_factory
{ {
empty_backend_factory() {} empty_backend_factory() {}
empty_session_backend* make_session(std::string const& connectString) c empty_session_backend* make_session(connection_parameters const& parame
onst; ters) const;
}; };
extern SOCI_EMPTY_DECL empty_backend_factory const empty; extern SOCI_EMPTY_DECL empty_backend_factory const empty;
extern "C" extern "C"
{ {
// for dynamic backend loading // for dynamic backend loading
SOCI_EMPTY_DECL backend_factory const* factory_empty(); SOCI_EMPTY_DECL backend_factory const* factory_empty();
SOCI_EMPTY_DECL void register_factory_empty(); SOCI_EMPTY_DECL void register_factory_empty();
 End of changes. 2 change blocks. 
4 lines changed or deleted 4 lines changed or added


 soci-mysql.h   soci-mysql.h 
skipping to change at line 230 skipping to change at line 230
virtual std::size_t write(std::size_t offset, char const *buf, virtual std::size_t write(std::size_t offset, char const *buf,
std::size_t toWrite); std::size_t toWrite);
virtual std::size_t append(char const *buf, std::size_t toWrite); virtual std::size_t append(char const *buf, std::size_t toWrite);
virtual void trim(std::size_t newLen); virtual void trim(std::size_t newLen);
mysql_session_backend &session_; mysql_session_backend &session_;
}; };
struct mysql_session_backend : details::session_backend struct mysql_session_backend : details::session_backend
{ {
mysql_session_backend(std::string const &connectString); mysql_session_backend(connection_parameters const & parameters);
~mysql_session_backend(); ~mysql_session_backend();
virtual void begin(); virtual void begin();
virtual void commit(); virtual void commit();
virtual void rollback(); virtual void rollback();
virtual std::string get_backend_name() const { return "mysql"; } virtual std::string get_backend_name() const { return "mysql"; }
void clean_up(); void clean_up();
virtual mysql_statement_backend * make_statement_backend(); virtual mysql_statement_backend * make_statement_backend();
virtual mysql_rowid_backend * make_rowid_backend(); virtual mysql_rowid_backend * make_rowid_backend();
virtual mysql_blob_backend * make_blob_backend(); virtual mysql_blob_backend * make_blob_backend();
MYSQL *conn_; MYSQL *conn_;
}; };
struct mysql_backend_factory : backend_factory struct mysql_backend_factory : backend_factory
{ {
mysql_backend_factory() {} mysql_backend_factory() {}
virtual mysql_session_backend * make_session( virtual mysql_session_backend * make_session(
std::string const &connectString) const; connection_parameters const & parameters) const;
}; };
extern SOCI_MYSQL_DECL mysql_backend_factory const mysql; extern SOCI_MYSQL_DECL mysql_backend_factory const mysql;
extern "C" extern "C"
{ {
// for dynamic backend loading // for dynamic backend loading
SOCI_MYSQL_DECL backend_factory const * factory_mysql(); SOCI_MYSQL_DECL backend_factory const * factory_mysql();
SOCI_MYSQL_DECL void register_factory_mysql(); SOCI_MYSQL_DECL void register_factory_mysql();
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 soci-odbc.h   soci-odbc.h 
skipping to change at line 32 skipping to change at line 32
#ifndef SOCI_ODBC_DECL #ifndef SOCI_ODBC_DECL
# define SOCI_ODBC_DECL # define SOCI_ODBC_DECL
#endif #endif
#include <vector> #include <vector>
#include <soci-backend.h> #include <soci-backend.h>
#if defined(_MSC_VER) || defined(__MINGW32__) #if defined(_MSC_VER) || defined(__MINGW32__)
#include <windows.h> #include <windows.h>
#endif #endif
#include <sqlext.h> // ODBC #include <sqlext.h> // ODBC
#include <string.h> // strcpy()
namespace soci namespace soci
{ {
// TODO: Do we want to make it a part of public interface? --mloskot // TODO: Do we want to make it a part of public interface? --mloskot
namespace details namespace details
{ {
std::size_t const odbc_max_buffer_length = 100 * 1024 * 1024; std::size_t const odbc_max_buffer_length = 100 * 1024 * 1024;
} }
// Option allowing to specify the "driver completion" parameter of
// SQLDriverConnect(). Its possible values are the same as the allowed valu
es
// for this parameter in the official ODBC, i.e. one of SQL_DRIVER_XXX (in
// string form as all options are strings currently).
extern SOCI_ODBC_DECL char const * odbc_option_driver_complete;
struct odbc_statement_backend; struct odbc_statement_backend;
struct odbc_standard_into_type_backend : details::standard_into_type_backen
d // Helper of into and use backends.
class odbc_standard_type_backend_base
{
protected:
odbc_standard_type_backend_base(odbc_statement_backend &st)
: statement_(st) {}
// Check if we need to pass 64 bit integers as strings to the database
as
// some drivers don't support them directly.
inline bool use_string_for_bigint() const;
// If we do need to use strings for 64 bit integers, this constant defi
nes
// the maximal string length needed.
enum
{
// This is the length of decimal representation of UINT64_MAX + 1.
max_bigint_length = 21
};
odbc_statement_backend &statement_;
};
struct odbc_standard_into_type_backend : details::standard_into_type_backen
d,
private odbc_standard_type_backend
_base
{ {
odbc_standard_into_type_backend(odbc_statement_backend &st) odbc_standard_into_type_backend(odbc_statement_backend &st)
: statement_(st), buf_(0) : odbc_standard_type_backend_base(st), buf_(0)
{} {}
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();
virtual void post_fetch(bool gotData, bool calledFromFetch, virtual void post_fetch(bool gotData, bool calledFromFetch,
indicator *ind); indicator *ind);
virtual void clean_up(); virtual void clean_up();
odbc_statement_backend &statement_;
char *buf_; // generic buffer char *buf_; // generic buffer
void *data_; void *data_;
details::exchange_type type_; details::exchange_type type_;
int position_; int position_;
SQLSMALLINT odbcType_; SQLSMALLINT odbcType_;
SQLLEN valueLen_; SQLLEN valueLen_;
}; };
struct odbc_vector_into_type_backend : details::vector_into_type_backend struct odbc_vector_into_type_backend : details::vector_into_type_backend,
private odbc_standard_type_backend_b
ase
{ {
odbc_vector_into_type_backend(odbc_statement_backend &st) odbc_vector_into_type_backend(odbc_statement_backend &st)
: statement_(st), indHolders_(NULL), : odbc_standard_type_backend_base(st), indHolders_(NULL),
data_(NULL), buf_(NULL) {} data_(NULL), buf_(NULL) {}
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();
virtual void post_fetch(bool gotData, indicator *ind); virtual void post_fetch(bool gotData, indicator *ind);
virtual void resize(std::size_t sz); virtual void resize(std::size_t sz);
virtual std::size_t size(); virtual std::size_t size();
virtual void clean_up(); virtual void clean_up();
// helper function for preparing indicators // helper function for preparing indicators
// (as part of the define_by_pos) // (as part of the define_by_pos)
void prepare_indicators(std::size_t size); void prepare_indicators(std::size_t size);
odbc_statement_backend &statement_;
SQLLEN *indHolders_; SQLLEN *indHolders_;
std::vector<SQLLEN> indHolderVec_; std::vector<SQLLEN> indHolderVec_;
void *data_; void *data_;
char *buf_; // generic buffer char *buf_; // generic buffer
details::exchange_type type_; details::exchange_type type_;
std::size_t colSize_; // size of the string column (used for strings ) std::size_t colSize_; // size of the string column (used for strings )
SQLSMALLINT odbcType_; SQLSMALLINT odbcType_;
}; };
struct odbc_standard_use_type_backend : details::standard_use_type_backend struct odbc_standard_use_type_backend : details::standard_use_type_backend,
private odbc_standard_type_backend_
base
{ {
odbc_standard_use_type_backend(odbc_statement_backend &st) odbc_standard_use_type_backend(odbc_statement_backend &st)
: statement_(st), data_(0), buf_(0), indHolder_(0) {} : odbc_standard_type_backend_base(st),
position_(-1), data_(0), buf_(0), indHolder_(0) {}
void prepare_for_bind(void *&data, SQLLEN &size,
SQLSMALLINT &sqlType, SQLSMALLINT &cType);
void bind_helper(int &position,
void *data, details::exchange_type type);
virtual void bind_by_pos(int &position, virtual void bind_by_pos(int &position,
void *data, details::exchange_type type, bool readOnly); void *data, details::exchange_type type, bool readOnly);
virtual void bind_by_name(std::string const &name, virtual void bind_by_name(std::string const &name,
void *data, details::exchange_type type, bool readOnly); void *data, details::exchange_type type, bool readOnly);
virtual void pre_use(indicator const *ind); virtual void pre_use(indicator const *ind);
virtual void post_use(bool gotData, indicator *ind); virtual void post_use(bool gotData, indicator *ind);
virtual void clean_up(); virtual void clean_up();
odbc_statement_backend &statement_; // Return the pointer to the buffer containing data to be used by ODBC.
// This can be either data_ itself or buf_, that is allocated by this
// function if necessary.
//
// Also fill in the size of the data and SQL and C types of it.
void* prepare_for_bind(SQLLEN &size,
SQLSMALLINT &sqlType, SQLSMALLINT &cType);
int position_;
void *data_; void *data_;
details::exchange_type type_; details::exchange_type type_;
char *buf_; char *buf_;
SQLLEN indHolder_; SQLLEN indHolder_;
}; };
struct odbc_vector_use_type_backend : details::vector_use_type_backend struct odbc_vector_use_type_backend : details::vector_use_type_backend,
private odbc_standard_type_backend_ba
se
{ {
odbc_vector_use_type_backend(odbc_statement_backend &st) odbc_vector_use_type_backend(odbc_statement_backend &st)
: statement_(st), indHolders_(NULL), : odbc_standard_type_backend_base(st), indHolders_(NULL),
data_(NULL), buf_(NULL) {} data_(NULL), buf_(NULL) {}
// helper function for preparing indicators // helper function for preparing indicators
// (as part of the define_by_pos) // (as part of the define_by_pos)
void prepare_indicators(std::size_t size); void prepare_indicators(std::size_t size);
// common part for bind_by_pos and bind_by_name // common part for bind_by_pos and bind_by_name
void prepare_for_bind(void *&data, SQLUINTEGER &size, SQLSMALLINT &sqlT ype, SQLSMALLINT &cType); void prepare_for_bind(void *&data, SQLUINTEGER &size, SQLSMALLINT &sqlT ype, SQLSMALLINT &cType);
void bind_helper(int &position, void bind_helper(int &position,
void *data, details::exchange_type type); void *data, details::exchange_type type);
skipping to change at line 152 skipping to change at line 187
void *data, details::exchange_type type); void *data, details::exchange_type type);
virtual void bind_by_name(std::string const &name, virtual void bind_by_name(std::string const &name,
void *data, details::exchange_type type); void *data, details::exchange_type type);
virtual void pre_use(indicator const *ind); virtual void pre_use(indicator const *ind);
virtual std::size_t size(); virtual std::size_t size();
virtual void clean_up(); virtual void clean_up();
odbc_statement_backend &statement_;
SQLLEN *indHolders_; SQLLEN *indHolders_;
std::vector<SQLLEN> indHolderVec_; std::vector<SQLLEN> indHolderVec_;
void *data_; void *data_;
details::exchange_type type_; details::exchange_type type_;
char *buf_; // generic buffer char *buf_; // generic buffer
std::size_t colSize_; // size of the string column (used for strings ) std::size_t colSize_; // size of the string column (used for strings )
// used for strings only // used for strings only
std::size_t maxSize_; std::size_t maxSize_;
}; };
skipping to change at line 200 skipping to change at line 233
virtual odbc_standard_use_type_backend * make_use_type_backend(); virtual odbc_standard_use_type_backend * make_use_type_backend();
virtual odbc_vector_into_type_backend * make_vector_into_type_backend() ; virtual odbc_vector_into_type_backend * make_vector_into_type_backend() ;
virtual odbc_vector_use_type_backend * make_vector_use_type_backend(); virtual odbc_vector_use_type_backend * make_vector_use_type_backend();
odbc_session_backend &session_; odbc_session_backend &session_;
SQLHSTMT hstmt_; SQLHSTMT hstmt_;
SQLUINTEGER numRowsFetched_; SQLUINTEGER numRowsFetched_;
bool hasVectorUseElements_; bool hasVectorUseElements_;
bool boundByName_; bool boundByName_;
bool boundByPos_; bool boundByPos_;
bool lastNoData_; // true if last query returned SQL_NO_DATA
std::string query_; std::string query_;
std::vector<std::string> names_; // list of names for named binds std::vector<std::string> names_; // list of names for named binds
}; };
struct odbc_rowid_backend : details::rowid_backend struct odbc_rowid_backend : details::rowid_backend
{ {
odbc_rowid_backend(odbc_session_backend &session); odbc_rowid_backend(odbc_session_backend &session);
skipping to change at line 232 skipping to change at line 266
virtual std::size_t write(std::size_t offset, char const *buf, virtual std::size_t write(std::size_t offset, char const *buf,
std::size_t toWrite); std::size_t toWrite);
virtual std::size_t append(char const *buf, std::size_t toWrite); virtual std::size_t append(char const *buf, std::size_t toWrite);
virtual void trim(std::size_t newLen); virtual void trim(std::size_t newLen);
odbc_session_backend &session_; odbc_session_backend &session_;
}; };
struct odbc_session_backend : details::session_backend struct odbc_session_backend : details::session_backend
{ {
odbc_session_backend(std::string const &connectString); odbc_session_backend(connection_parameters const & parameters);
~odbc_session_backend(); ~odbc_session_backend();
virtual void begin(); virtual void begin();
virtual void commit(); virtual void commit();
virtual void rollback(); virtual void rollback();
virtual bool get_next_sequence_value(session & s,
std::string const & sequence, long & value);
virtual bool get_last_insert_id(session & s,
std::string const & table, long & value);
virtual std::string get_backend_name() const { return "odbc"; } virtual std::string get_backend_name() const { return "odbc"; }
void reset_transaction(); void reset_transaction();
void clean_up(); void clean_up();
virtual odbc_statement_backend * make_statement_backend(); virtual odbc_statement_backend * make_statement_backend();
virtual odbc_rowid_backend * make_rowid_backend(); virtual odbc_rowid_backend * make_rowid_backend();
virtual odbc_blob_backend * make_blob_backend(); virtual odbc_blob_backend * make_blob_backend();
enum database_product
{
prod_uninitialized, // Never returned by get_database_product().
prod_firebird,
prod_mssql,
prod_mysql,
prod_oracle,
prod_postgresql,
prod_sqlite,
prod_unknown = -1
};
// Determine the type of the database we're connected to.
database_product get_database_product();
// Return full ODBC connection string.
std::string get_connection_string() const { return connection_string_;
}
SQLHENV henv_; SQLHENV henv_;
SQLHDBC hdbc_; SQLHDBC hdbc_;
std::string connection_string_;
database_product product_;
}; };
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(msg)
{ {
const char* socierror = NULL;
SQLSMALLINT length, i = 1; SQLSMALLINT length, i = 1;
SQLGetDiagRec(htype, hndl, i, sqlstate_, &sqlcode_, switch ( SQLGetDiagRec(htype, hndl, i, sqlstate_, &sqlcode_,
message_, SQL_MAX_MESSAGE_LENGTH + 1, message_, SQL_MAX_MESSAGE_LENGTH + 1,
&length); &length) )
{
case SQL_SUCCESS:
// The error message was successfully retrieved.
break;
case SQL_INVALID_HANDLE:
socierror = "[SOCI]: Invalid handle.";
break;
case SQL_ERROR:
socierror = "[SOCI]: SQLGetDiagRec() error.";
break;
case SQL_SUCCESS_WITH_INFO:
socierror = "[SOCI]: Error message too long.";
break;
case SQL_NO_DATA:
socierror = "[SOCI]: No error.";
break;
default:
socierror = "[SOCI]: Unexpected SQLGetDiagRec() return value.";
break;
}
if (length == 0) if (socierror)
{ {
message_[0] = 0; // Use our own error message if we failed to retrieve the ODBC
one.
strcpy(reinterpret_cast<char*>(message_), socierror);
// Use "General warning" SQLSTATE code.
strcpy(reinterpret_cast<char*>(sqlstate_), "01000");
sqlcode_ = 0; sqlcode_ = 0;
} }
} }
SQLCHAR const * odbc_error_code() const SQLCHAR const * odbc_error_code() const
{ {
return reinterpret_cast<SQLCHAR const *>(sqlstate_); return reinterpret_cast<SQLCHAR const *>(sqlstate_);
} }
SQLINTEGER native_error_code() const SQLINTEGER native_error_code() const
{ {
skipping to change at line 304 skipping to change at line 396
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
{ {
return false; return false;
} }
} }
inline bool odbc_standard_type_backend_base::use_string_for_bigint() const
{
// Oracle ODBC driver doesn't support SQL_C_[SU]BIGINT data types
// (see appendix G.1 of Oracle Database Administrator's reference at
// http://docs.oracle.com/cd/B19306_01/server.102/b15658/app_odbc.htm),
// so we need a special workaround for this case and we represent 64
// bit integers as strings and rely on ODBC driver for transforming
// them to SQL_NUMERIC.
return statement_.session_.get_database_product()
== odbc_session_backend::prod_oracle;
}
struct odbc_backend_factory : backend_factory struct odbc_backend_factory : backend_factory
{ {
odbc_backend_factory() {} odbc_backend_factory() {}
virtual odbc_session_backend * make_session( virtual odbc_session_backend * make_session(
std::string const &connectString) const; connection_parameters const & parameters) const;
}; };
extern SOCI_ODBC_DECL odbc_backend_factory const odbc; extern SOCI_ODBC_DECL odbc_backend_factory const odbc;
extern "C" extern "C"
{ {
// for dynamic backend loading // for dynamic backend loading
SOCI_ODBC_DECL backend_factory const * factory_odbc(); SOCI_ODBC_DECL backend_factory const * factory_odbc();
SOCI_ODBC_DECL void register_factory_odbc(); SOCI_ODBC_DECL void register_factory_odbc();
 End of changes. 26 change blocks. 
28 lines changed or deleted 141 lines changed or added


 soci-platform.h   soci-platform.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_PLATFORM_H_INCLUDED #ifndef SOCI_PLATFORM_H_INCLUDED
#define SOCI_PLATFORM_H_INCLUDED #define SOCI_PLATFORM_H_INCLUDED
// Portability hacks for Microsoft Visual C++ compiler // Portability hacks for Microsoft Visual C++ compiler
#ifdef _MSC_VER #ifdef _MSC_VER
#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 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 HAVE_SNPRINTF 1
#define snprintf _snprintf #define snprintf _snprintf
// Define if you have the strtoll variants. // Define if you have the strtoll and strtoull variants.
#if _MSC_VER >= 1300 #if _MSC_VER >= 1300
# define HAVE_STRTOLL 1 # define HAVE_STRTOLL 1
# define strtoll(nptr, endptr, base) _strtoi64(nptr, endptr, base) # define HAVE_STRTOULL 1
namespace std {
inline long long strtoll(char const* str, char** str_end, int base)
{
return _strtoi64(str, str_end, base);
}
inline unsigned long long strtoull(char const* str, char** str_end, int
base)
{
return _strtoui64(str, str_end, base);
}
}
#else #else
# undef HAVE_STRTOLL # undef HAVE_STRTOLL
# error "Visual C++ versions prior 1300 don't support strtoi64" # undef HAVE_STRTOULL
# error "Visual C++ versions prior 1300 don't support _strtoi64 and _strtou
i64"
#endif // _MSC_VER >= 1300 #endif // _MSC_VER >= 1300
#endif // _MSC_VER #endif // _MSC_VER
#endif // SOCI_PLATFORM_H_INCLUDED #endif // SOCI_PLATFORM_H_INCLUDED
 End of changes. 5 change blocks. 
4 lines changed or deleted 18 lines changed or added


 soci-postgresql.h   soci-postgresql.h 
skipping to change at line 147 skipping to change at line 147
details::exchange_type type_; details::exchange_type type_;
int position_; int position_;
std::string name_; std::string name_;
std::vector<char *> buffers_; std::vector<char *> buffers_;
}; };
struct postgresql_session_backend; struct postgresql_session_backend;
struct postgresql_statement_backend : details::statement_backend struct postgresql_statement_backend : details::statement_backend
{ {
postgresql_statement_backend(postgresql_session_backend & session); postgresql_statement_backend(postgresql_session_backend & session);
~postgresql_statement_backend();
virtual void alloc(); virtual void alloc();
virtual void clean_up(); virtual void clean_up();
virtual void prepare(std::string const & query, virtual void prepare(std::string const & query,
details::statement_type stType); details::statement_type stType);
virtual exec_fetch_result execute(int number); virtual exec_fetch_result execute(int number);
virtual exec_fetch_result fetch(int number); virtual exec_fetch_result fetch(int number);
virtual long long get_affected_rows(); virtual long long get_affected_rows();
skipping to change at line 231 skipping to change at line 232
virtual void trim(std::size_t newLen); virtual void trim(std::size_t newLen);
postgresql_session_backend & session_; postgresql_session_backend & session_;
unsigned long oid_; // oid of the large object unsigned long oid_; // oid of the large object
int fd_; // descriptor of the large object int fd_; // descriptor of the large object
}; };
struct postgresql_session_backend : details::session_backend struct postgresql_session_backend : details::session_backend
{ {
postgresql_session_backend(std::string const & connectString); postgresql_session_backend(connection_parameters const & parameters);
~postgresql_session_backend(); ~postgresql_session_backend();
virtual void begin(); virtual void begin();
virtual void commit(); virtual void commit();
virtual void rollback(); virtual void rollback();
void deallocate_prepared_statement(const std::string & statementName);
virtual std::string get_backend_name() const { return "postgresql"; } virtual std::string get_backend_name() const { return "postgresql"; }
void clean_up(); void clean_up();
virtual postgresql_statement_backend * make_statement_backend(); virtual postgresql_statement_backend * make_statement_backend();
virtual postgresql_rowid_backend * make_rowid_backend(); virtual postgresql_rowid_backend * make_rowid_backend();
virtual postgresql_blob_backend * make_blob_backend(); virtual postgresql_blob_backend * make_blob_backend();
std::string get_next_statement_name(); std::string get_next_statement_name();
int statementCount_; int statementCount_;
PGconn * conn_; PGconn * conn_;
}; };
struct postgresql_backend_factory : backend_factory struct postgresql_backend_factory : backend_factory
{ {
postgresql_backend_factory() {} postgresql_backend_factory() {}
virtual postgresql_session_backend * make_session( virtual postgresql_session_backend * make_session(
std::string const & connectString) const; connection_parameters const & parameters) const;
}; };
extern SOCI_POSTGRESQL_DECL postgresql_backend_factory const postgresql; extern SOCI_POSTGRESQL_DECL postgresql_backend_factory const postgresql;
extern "C" extern "C"
{ {
// for dynamic backend loading // for dynamic backend loading
SOCI_POSTGRESQL_DECL backend_factory const * factory_postgresql(); SOCI_POSTGRESQL_DECL backend_factory const * factory_postgresql();
SOCI_POSTGRESQL_DECL void register_factory_postgresql(); SOCI_POSTGRESQL_DECL void register_factory_postgresql();
 End of changes. 5 change blocks. 
3 lines changed or deleted 6 lines changed or added


 soci-sqlite3.h   soci-sqlite3.h 
skipping to change at line 237 skipping to change at line 237
std::size_t set_data(char const *buf, std::size_t toWrite); std::size_t set_data(char const *buf, std::size_t toWrite);
private: private:
char *buf_; char *buf_;
size_t len_; size_t len_;
}; };
struct sqlite3_session_backend : details::session_backend struct sqlite3_session_backend : details::session_backend
{ {
sqlite3_session_backend(std::string const &connectString); sqlite3_session_backend(connection_parameters const & parameters);
~sqlite3_session_backend(); ~sqlite3_session_backend();
virtual void begin(); virtual void begin();
virtual void commit(); virtual void commit();
virtual void rollback(); virtual void rollback();
virtual std::string get_backend_name() const { return "sqlite3"; } virtual std::string get_backend_name() const { return "sqlite3"; }
void clean_up(); void clean_up();
virtual sqlite3_statement_backend * make_statement_backend(); virtual sqlite3_statement_backend * make_statement_backend();
virtual sqlite3_rowid_backend * make_rowid_backend(); virtual sqlite3_rowid_backend * make_rowid_backend();
virtual sqlite3_blob_backend * make_blob_backend(); virtual sqlite3_blob_backend * make_blob_backend();
sqlite_api::sqlite3 *conn_; sqlite_api::sqlite3 *conn_;
}; };
struct sqlite3_backend_factory : backend_factory struct sqlite3_backend_factory : backend_factory
{ {
sqlite3_backend_factory() {} sqlite3_backend_factory() {}
virtual sqlite3_session_backend * make_session( virtual sqlite3_session_backend * make_session(
std::string const &connectString) const; connection_parameters const & parameters) const;
}; };
extern SOCI_SQLITE3_DECL sqlite3_backend_factory const sqlite3; extern SOCI_SQLITE3_DECL sqlite3_backend_factory const sqlite3;
extern "C" extern "C"
{ {
// for dynamic backend loading // for dynamic backend loading
SOCI_SQLITE3_DECL backend_factory const * factory_sqlite3(); SOCI_SQLITE3_DECL backend_factory const * factory_sqlite3();
SOCI_SQLITE3_DECL void register_factory_sqlite3(); SOCI_SQLITE3_DECL void register_factory_sqlite3();
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added


 type-conversion.h   type-conversion.h 
skipping to change at line 89 skipping to change at line 89
{ {
public: public:
typedef typename type_conversion<T>::base_type base_type; typedef typename type_conversion<T>::base_type base_type;
conversion_use_type(T & value, std::string const & name = std::string() ) conversion_use_type(T & value, std::string const & name = std::string() )
: use_type<base_type>(details::base_value_holder<T>::val_, ownInd_, name) : use_type<base_type>(details::base_value_holder<T>::val_, ownInd_, name)
, value_(value) , value_(value)
, ind_(ownInd_) , ind_(ownInd_)
, readOnly_(false) , readOnly_(false)
{ {
// TODO: likely to be removed (SHA: c166625a28f7c907318134f625ff5ac ea7d9a1f8)
//convert_to_base(); //convert_to_base();
} }
conversion_use_type(T const & value, std::string const & name = std::st ring()) conversion_use_type(T const & value, std::string const & name = std::st ring())
: use_type<base_type>(details::base_value_holder<T>::val_, ownInd_, name) : use_type<base_type>(details::base_value_holder<T>::val_, ownInd_, name)
, value_(const_cast<T &>(value)) , value_(const_cast<T &>(value))
, ind_(ownInd_) , ind_(ownInd_)
, readOnly_(true) , readOnly_(true)
{ {
// TODO: likely to be removed (SHA: c166625a28f7c907318134f625ff5ac ea7d9a1f8)
//convert_to_base(); //convert_to_base();
} }
conversion_use_type(T & value, indicator & ind, conversion_use_type(T & value, indicator & ind,
std::string const & name = std::string()) std::string const & name = std::string())
: use_type<base_type>(details::base_value_holder<T>::val_, ind, nam e) : use_type<base_type>(details::base_value_holder<T>::val_, ind, nam e)
, value_(value) , value_(value)
, ind_(ind) , ind_(ind)
, readOnly_(false) , readOnly_(false)
{ {
// TODO: likely to be removed (SHA: c166625a28f7c907318134f625ff5ac ea7d9a1f8)
//convert_to_base(); //convert_to_base();
} }
conversion_use_type(T const & value, indicator & ind, conversion_use_type(T const & value, indicator & ind,
std::string const & name = std::string()) std::string const & name = std::string())
: use_type<base_type>(details::base_value_holder<T>::val_, ind, nam e) : use_type<base_type>(details::base_value_holder<T>::val_, ind, nam e)
, value_(value) , value_(const_cast<T &>(value))
, ind_(ind) , ind_(ind)
, readOnly_(false) , readOnly_(true)
{ {
// TODO: likely to be removed (SHA: c166625a28f7c907318134f625ff5ac ea7d9a1f8)
//convert_to_base(); //convert_to_base();
} }
void convert_from_base() void convert_from_base()
{ {
// NOTE:
// readOnly_ flag indicates that use_type object has been generated
// based on non-const object passed by user as input argument.
// For const objects, this is effectively no-op conversion.
// See standard_use_type::post_use() for more details.
if (readOnly_ == false) if (readOnly_ == false)
{ {
type_conversion<T>::from_base( type_conversion<T>::from_base(
details::base_value_holder<T>::val_, ind_, value_); details::base_value_holder<T>::val_, ind_, value_);
} }
} }
void convert_to_base() void convert_to_base()
{ {
type_conversion<T>::to_base(value_, type_conversion<T>::to_base(value_,
 End of changes. 7 change blocks. 
2 lines changed or deleted 12 lines changed or added


 type-holder.h   type-holder.h 
skipping to change at line 36 skipping to change at line 36
public: public:
holder() {} holder() {}
virtual ~holder() {} virtual ~holder() {}
template<typename T> template<typename T>
T get() T get()
{ {
type_holder<T>* p = dynamic_cast<type_holder<T> *>(this); type_holder<T>* p = dynamic_cast<type_holder<T> *>(this);
if (p) if (p)
{ {
return p->value<T>(); return p->template value<T>();
} }
else else
{ {
throw std::bad_cast(); throw std::bad_cast();
} }
} }
private: private:
template<typename T> template<typename T>
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 use-type.h   use-type.h 
skipping to change at line 53 skipping to change at line 53
standard_use_type(void* data, exchange_type type, standard_use_type(void* data, exchange_type type,
bool readOnly, std::string const& name = std::string()) bool readOnly, std::string const& name = std::string())
: data_(data) : data_(data)
, type_(type) , type_(type)
, ind_(NULL) , ind_(NULL)
, readOnly_(readOnly) , readOnly_(readOnly)
, name_(name) , name_(name)
, backEnd_(NULL) , backEnd_(NULL)
{ {
// FIXME: This was added with Ilia's patch // FIXME: This was added with Ilia's patch
// http://soci.git.sourceforge.net/git/gitweb.cgi?p=soci/soci;a=blo bdiff;f=src/core/use-type.h;h=3510ac95fe7530f977bf9e78d74fd502164a4071;hp=b 6d9ba9c27aef3640b8edac4b8e44a620b1b5294;hb=c166625a28f7c907318134f625ff5ace a7d9a1f8;hpb=ec19564b2f0994b3960acf891643d92fc224b453 // https://github.com/SOCI/soci/commit/c166625a28f7c907318134f625ff 5acea7d9a1f8
// but it seems to be a troublemaker, causing duplicated conversion s // but it seems to be a troublemaker, causing duplicated conversion s
//convert_to_base(); //convert_to_base();
} }
standard_use_type(void* data, exchange_type type, indicator& ind, standard_use_type(void* data, exchange_type type, indicator& ind,
bool readOnly, std::string const& name = std::string()) bool readOnly, std::string const& name = std::string())
: data_(data) : data_(data)
, type_(type) , type_(type)
, ind_(&ind) , ind_(&ind)
, readOnly_(readOnly) , readOnly_(readOnly)
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 values.h   values.h 
skipping to change at line 223 skipping to change at line 223
void uppercase_column_names(bool forceToUpper) void uppercase_column_names(bool forceToUpper)
{ {
uppercaseColumnNames_ = forceToUpper; uppercaseColumnNames_ = forceToUpper;
} }
column_properties const& get_properties(std::size_t pos) const; column_properties const& get_properties(std::size_t pos) const;
column_properties const& get_properties(std::string const &name) const; column_properties const& get_properties(std::string const &name) const;
private: private:
//TODO To make values generally usable outside of TypeConversionS, //TODO To make values generally usable outside of type_conversion's,
// these should be reference counted smart pointers // these should be reference counted smart pointers
row * row_; row * row_;
std::vector<details::standard_use_type *> uses_; std::vector<details::standard_use_type *> uses_;
std::map<details::use_type_base *, indicator *> unused_; std::map<details::use_type_base *, indicator *> unused_;
std::vector<indicator *> indicators_; std::vector<indicator *> indicators_;
std::map<std::string, std::size_t> index_; std::map<std::string, std::size_t> index_;
std::vector<details::copy_base *> deepCopies_; std::vector<details::copy_base *> deepCopies_;
mutable std::size_t currentPos_; mutable std::size_t currentPos_;
bool uppercaseColumnNames_; bool uppercaseColumnNames_;
// When TypeConversion::to() is called, a values object is created // When type_conversion::to() is called, a values object is created
// without an underlying row object. In that case, get_from_uses() // without an underlying row object. In that case, get_from_uses()
// returns the underlying field values // returns the underlying field values
template <typename T> template <typename T>
T get_from_uses(std::string const & name, T const & nullValue) const T get_from_uses(std::string const & name, T const & nullValue) const
{ {
std::map<std::string, std::size_t>::const_iterator pos = index_.fin d(name); std::map<std::string, std::size_t>::const_iterator pos = index_.fin d(name);
if (pos != index_.end()) if (pos != index_.end())
{ {
if (*indicators_[pos->second] == i_null) if (*indicators_[pos->second] == i_null)
{ {
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 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 300100 #define SOCI_VERSION 300200
// //
// 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_1_0" #define SOCI_LIB_VERSION "3_2_0"
#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/