aboutsummaryrefslogtreecommitdiff
path: root/odb/mysql/enum.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/mysql/enum.cxx')
-rw-r--r--odb/mysql/enum.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/odb/mysql/enum.cxx b/odb/mysql/enum.cxx
new file mode 100644
index 0000000..d2c8676
--- /dev/null
+++ b/odb/mysql/enum.cxx
@@ -0,0 +1,34 @@
+// file : odb/mysql/enums.cxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#include <cstring> // std::memmove
+#include <cassert>
+
+#include <odb/mysql/enum.hxx>
+
+namespace odb
+{
+ namespace mysql
+ {
+ void enum_traits::
+ strip_value (const details::buffer& i, unsigned long& size)
+ {
+ char* d (const_cast<char*> (i.data ()));
+
+ unsigned long p (0);
+ for (; p < size && d[p] != ' '; ++p) ;
+ assert (p != size);
+
+ p++; // Skip space;
+ size -= p;
+
+ std::memmove (d, d + p, size);
+ }
+ }
+}
+
+#include <odb/post.hxx>
+
+#endif // ODB_MYSQL_ENUMS_HXX