diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-03-31 15:36:02 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-04-22 14:38:40 +0200 |
commit | 621bc135b9825fc9f18ada204f67d3800c5f6fda (patch) | |
tree | fa94cea520c51c44f5fc25b85d7932b7f738a4aa /odb/qt/mysql/qbytearray-traits.hxx | |
parent | f43df635ef3efbb9ac242024c95c5949fb21a919 (diff) |
Complete qt/basic and qt/date-time implementations
Diffstat (limited to 'odb/qt/mysql/qbytearray-traits.hxx')
-rw-r--r-- | odb/qt/mysql/qbytearray-traits.hxx | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/odb/qt/mysql/qbytearray-traits.hxx b/odb/qt/mysql/qbytearray-traits.hxx deleted file mode 100644 index d94bf44..0000000 --- a/odb/qt/mysql/qbytearray-traits.hxx +++ /dev/null @@ -1,71 +0,0 @@ -// file : odb/qt/mysql/qbytearray-traits.hxx -// author : Constantin Michael <constantin@codesynthesis.com> -// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef ODB_QT_MYSQL_QBYTEARRAY_TRAITS_HXX -#define ODB_QT_MYSQL_QBYTEARRAY_TRAITS_HXX - -#include <odb/pre.hxx> - -#include <cstring> // std::memcpy -#include <cstddef> // std::size_t - -#include <QByteArray> - -#include <odb/details/buffer.hxx> -#include <odb/mysql/traits.hxx> - -namespace odb -{ - namespace mysql - { - template <> - class default_value_traits<QByteArray, details::buffer, id_blob> - { - public: - typedef QByteArray value_type; - typedef QByteArray query_type; - typedef details::buffer image_type; - - static void - set_value (QByteArray& v, - const details::buffer& b, - std::size_t n, - bool is_null) - { - if (is_null) - v = QByteArray (); - else - { - if (v.capacity () < n + 1) - v.reserve (n + 1); - - std::memcpy (v.data (), b.data (), n); - v.resize (n); - } - } - - static void - set_image (details::buffer& b, - std::size_t& n, - bool& is_null, - const QByteArray& v) - { - if (v.is_null) - is_null = true; - else - { - n = v.size (); - if (n > b.capacity ()) - b.capacity (n); - - if (n != 0) - std::memcpy (v.data (), b.data (), n); - } - } - }; - } -} - -#endif // ODB_QT_MYSQL_QBYTEARRAY_TRAITS_HXX |