diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2024-01-22 15:58:08 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2024-01-24 17:02:47 +0300 |
commit | 823026b58211a4166de06ac243d978dcb9930271 (patch) | |
tree | 97b43039cb769f8bee410e8536f9f945f2825153 /odb/instance.cxx | |
parent | b56b9c6796d8853758f0f5967488260d61b788e2 (diff) |
Turn odb repository into muti-package repository
Also remove the autoconf/make-based build system.
Diffstat (limited to 'odb/instance.cxx')
-rw-r--r-- | odb/instance.cxx | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/odb/instance.cxx b/odb/instance.cxx deleted file mode 100644 index 2d10239..0000000 --- a/odb/instance.cxx +++ /dev/null @@ -1,73 +0,0 @@ -// file : odb/instance.cxx -// license : GNU GPL v3; see accompanying LICENSE file - -#include <sstream> -#include <cstdlib> // abort -#include <cxxabi.h> // abi::__cxa_demangle - -#include <odb/instance.hxx> - -using namespace std; - -struct demangled_name -{ - demangled_name (): s (0), n (0) {} - ~demangled_name () {free (s);} - char* s; - size_t n; -}; - -static demangled_name name_; - -string entry_base:: -name (type_info const& ti) -{ - char*& s (name_.s); - - { - int r; - s = abi::__cxa_demangle (ti.name (), s, &name_.n, &r); - - if (r != 0) - abort (); // We are in static initialization, so this is fatal. - } - - string str (s), r; - - // Get the first component. It can be a database kind or name. - // - string::size_type p (str.find ("::")); - - if (p == string::npos) - abort (); // Derived type should be in a namespace. - - string n (str, 0, p); - - // See if it is one of the known kinds. - // - if (n == "relational") - { - r = n; - p = str.find ("::", 12); // 12 for "relational::" - n.assign (str, 12, p == string::npos ? p : p - 12); - } - - // See if it is one of the known databases. - // - database db; - istringstream is (n); - if (!(is >> db)) - { - if (r.empty ()) - abort (); // Has to have either kind or database. - } - else - { - if (!r.empty ()) - r += "::"; - - r += n; - } - - return r; -} |