/usr/include/soci/values-exchange.h is in libsoci-dev 3.2.3-2ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | //
// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef SOCI_VALUES_EXCHANGE_H_INCLUDED
#define SOCI_VALUES_EXCHANGE_H_INCLUDED
#include "values.h"
#include "into-type.h"
#include "use-type.h"
#include "row-exchange.h"
// std
#include <cstddef>
#include <string>
#include <vector>
namespace soci
{
namespace details
{
template <>
struct exchange_traits<values>
{
typedef basic_type_tag type_family;
// dummy value to satisfy the template engine, never used
enum { x_type = 0 };
};
template <>
class use_type<values> : public use_type_base
{
public:
use_type(values & v, std::string const & /*name*/ = std::string())
: v_(v)
{}
// we ignore the possibility to have the whole values as NULL
use_type(values & v, indicator /*ind*/, std::string const & /*name*/ = std::string())
: v_(v)
{}
virtual void bind(details::statement_impl & st, int & /*position*/)
{
v_.uppercase_column_names(st.session_.get_uppercase_column_names());
convert_to_base();
st.bind(v_);
}
virtual void post_use(bool /*gotData*/)
{
v_.reset_get_counter();
convert_from_base();
}
virtual void pre_use() {convert_to_base();}
virtual void clean_up() {v_.clean_up();}
virtual std::size_t size() const { return 1; }
// these are used only to re-dispatch to derived class
// (the derived class might be generated automatically by
// user conversions)
virtual void convert_to_base() {}
virtual void convert_from_base() {}
private:
values & v_;
};
// this is not supposed to be used - no support for bulk ORM
template <>
class use_type<std::vector<values> >
{
private:
use_type();
};
template <>
class into_type<values> : public into_type<row>
{
public:
into_type(values & v)
: into_type<row>(v.get_row()), v_(v)
{}
into_type(values & v, indicator & ind)
: into_type<row>(v.get_row(), ind), v_(v)
{}
void clean_up()
{
v_.clean_up();
}
private:
values & v_;
};
// this is not supposed to be used - no support for bulk ORM
template <>
class into_type<std::vector<values> >
{
private:
into_type();
};
} // namespace details
} // namespace soci
#endif // SOCI_VALUES_EXCHANGE_H_INCLUDED
|