aboutsummaryrefslogtreecommitdiff
path: root/odb/oracle/traits.txx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/oracle/traits.txx')
-rw-r--r--odb/oracle/traits.txx62
1 files changed, 62 insertions, 0 deletions
diff --git a/odb/oracle/traits.txx b/odb/oracle/traits.txx
index 7916ef7..f620e18 100644
--- a/odb/oracle/traits.txx
+++ b/odb/oracle/traits.txx
@@ -65,5 +65,67 @@ namespace odb
*b = c;
return true;
}
+
+#ifdef ODB_CXX11
+ //
+ // default_value_traits<std::array<char, N>, id_blob>
+ //
+
+ template <std::size_t N>
+ bool default_value_traits<std::array<char, N>, id_blob>::
+ result_callback (void* c, ub4* position, void* b, ub4 s, chunk_position)
+ {
+ ub4 n (*position + s < N ? s : N - *position);
+ std::memcpy (static_cast<char*> (c) + *position, b, n);
+ *position += n;
+ return true;
+ }
+
+ template <std::size_t N>
+ bool default_value_traits<std::array<char, N>, id_blob>::
+ param_callback (const void* c,
+ ub4*,
+ const void** b,
+ ub4* s,
+ chunk_position* p,
+ void*,
+ ub4)
+ {
+ *p = chunk_one;
+ *s = static_cast<ub4> (N);
+ *b = c;
+ return true;
+ }
+
+ //
+ // default_value_traits<std::array<unsigned char, N>, id_blob>
+ //
+
+ template <std::size_t N>
+ bool default_value_traits<std::array<unsigned char, N>, id_blob>::
+ result_callback (void* c, ub4* position, void* b, ub4 s, chunk_position)
+ {
+ ub4 n (*position + s < N ? s : N - *position);
+ std::memcpy (static_cast<unsigned char*> (c) + *position, b, n);
+ *position += n;
+ return true;
+ }
+
+ template <std::size_t N>
+ bool default_value_traits<std::array<unsigned char, N>, id_blob>::
+ param_callback (const void* c,
+ ub4*,
+ const void** b,
+ ub4* s,
+ chunk_position* p,
+ void*,
+ ub4)
+ {
+ *p = chunk_one;
+ *s = static_cast<ub4> (N);
+ *b = c;
+ return true;
+ }
+#endif
}
}