aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/traits.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/sqlite/traits.cxx')
-rw-r--r--odb/sqlite/traits.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/odb/sqlite/traits.cxx b/odb/sqlite/traits.cxx
index e73462a..96e201d 100644
--- a/odb/sqlite/traits.cxx
+++ b/odb/sqlite/traits.cxx
@@ -15,8 +15,10 @@ namespace odb
{
using details::buffer;
+ //
// default_value_traits<std::string>
//
+
void default_value_traits<string, id_text>::
set_image (buffer& b,
size_t& n,
@@ -33,8 +35,10 @@ namespace odb
memcpy (b.data (), v.c_str (), n);
}
+ //
// default_value_traits<const char*>
//
+
void default_value_traits<const char*, id_text>::
set_image (buffer& b,
size_t& n,
@@ -50,5 +54,27 @@ namespace odb
if (n != 0)
memcpy (b.data (), v, n);
}
+
+ //
+ // default_value_traits<vector<char>, id_blob>
+ //
+
+ void default_value_traits<vector<char>, id_blob>::
+ set_image (details::buffer& b,
+ size_t& n,
+ bool& is_null,
+ const value_type& v)
+ {
+ is_null = false;
+ n = v.size ();
+
+ if (n > b.capacity ())
+ b.capacity (n);
+
+ // std::vector::data() may not be available in older compilers.
+ //
+ if (n != 0)
+ memcpy (b.data (), &v[0], n);
+ }
}
}