From 6613fbc2a3fc96b491b6691145c72c5a9550dc84 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 25 Aug 2022 20:54:40 +0300 Subject: Add target to build configuration id --- libbrep/common-traits.hxx | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'libbrep/common-traits.hxx') diff --git a/libbrep/common-traits.hxx b/libbrep/common-traits.hxx index 99e8f3e..141a738 100644 --- a/libbrep/common-traits.hxx +++ b/libbrep/common-traits.hxx @@ -10,12 +10,50 @@ #include +#include + #include namespace odb { namespace pgsql { + // target_triplet + // + template <> + class value_traits: + value_traits + { + public: + using value_type = butl::target_triplet; + using query_type = butl::target_triplet; + using image_type = details::buffer; + + using base_type = value_traits; + + static void + set_value (value_type& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + std::string s; + base_type::set_value (s, b, n, is_null); + v = !s.empty () ? value_type (s) : value_type (); + } + + static void + set_image (details::buffer& b, + std::size_t& n, + bool& is_null, + const value_type& v) + { + base_type::set_image (b, n, is_null, v.string ()); + } + }; + + // package_name + // template <> class value_traits: value_traits -- cgit v1.1