From f3f9389365a03603c6f9bcc4d502ff4049c72fe2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Jul 2012 15:17:12 +0200 Subject: Add support for custom database type mapping New pragma qualifier, map, and specifiers: as, to, from. New tests: /custom. --- odb/mssql/details/conversion.hxx | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 odb/mssql/details/conversion.hxx (limited to 'odb/mssql/details') diff --git a/odb/mssql/details/conversion.hxx b/odb/mssql/details/conversion.hxx new file mode 100644 index 0000000..4b419da --- /dev/null +++ b/odb/mssql/details/conversion.hxx @@ -0,0 +1,59 @@ +// file : odb/mssql/details/conversion.hxx +// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_MSSQL_DETAILS_CONVERSION_HXX +#define ODB_MSSQL_DETAILS_CONVERSION_HXX + +#include + +#include + +namespace odb +{ + // @@ Revise this. + // + namespace details {} + + namespace mssql + { + namespace details + { + using namespace odb::details; + + // Detect whether conversion is specified in type_traits. + // + template + meta::yes + conversion_p_test (typename type_traits::conversion*); + + template + meta::no + conversion_p_test (...); + + template + struct conversion_p + { + static const bool value = + sizeof (conversion_p_test (0)) == sizeof (meta::yes); + }; + + template ::value> + struct conversion; + + template + struct conversion + { + static const char* to () {return type_traits::conversion::to ();} + }; + + template + struct conversion + { + static const char* to () {return 0;} + }; + } + } +} + +#endif // ODB_MSSQL_DETAILS_CONVERSION_HXX -- cgit v1.1