From ab1487672afb5180bd17c9d26b35196bd06f6cda Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 28 Jul 2011 09:45:36 +0200 Subject: Add value_traits specializations for std::vector This allows using it as a buffer for BLOB mapping. --- mysql/types/traits.hxx | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) (limited to 'mysql/types/traits.hxx') diff --git a/mysql/types/traits.hxx b/mysql/types/traits.hxx index 2698afc..09d50a1 100644 --- a/mysql/types/traits.hxx +++ b/mysql/types/traits.hxx @@ -10,7 +10,7 @@ #include -#include "test.hxx" // date_time, buffer, string_ptr +#include "test.hxx" // date_time, string_ptr namespace odb { @@ -57,43 +57,6 @@ namespace odb }; template <> - class value_traits - { - public: - typedef buffer value_type; - typedef buffer query_type; - typedef details::buffer image_type; - - static void - set_value (buffer& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (!is_null) - v.assign (b.data (), n); - else - v.assign (0, 0); - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const buffer& v) - { - is_null = false; - n = v.size (); - - if (n > b.capacity ()) - b.capacity (n); - - if (n != 0) - std::memcpy (b.data (), v.data (), n); - } - }; - - template <> class value_traits { public: -- cgit v1.1