summaryrefslogtreecommitdiff
path: root/libxsd/xsd/cxx/tree/bits
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-04-21 23:42:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-04-21 23:42:07 +0200
commit69261c4b5fa020ad50bcd15f3b7e3e881ad6ded7 (patch)
treefdf69126584f6c6404704bdea92815380d616d97 /libxsd/xsd/cxx/tree/bits
parent5a5a9927f7c0746cec19bf3f1f789de6d4d1410a (diff)
Work around the GCC visibility and specialization issue
If a template has any specializations, it is considered as defined by GCC and any attempt to later set a visibility attribute via explicit instantiation has no effect.
Diffstat (limited to 'libxsd/xsd/cxx/tree/bits')
-rw-r--r--libxsd/xsd/cxx/tree/bits/literals.hxx78
-rw-r--r--libxsd/xsd/cxx/tree/bits/literals.ixx270
2 files changed, 348 insertions, 0 deletions
diff --git a/libxsd/xsd/cxx/tree/bits/literals.hxx b/libxsd/xsd/cxx/tree/bits/literals.hxx
index 6fe6ddd..49ac0ca 100644
--- a/libxsd/xsd/cxx/tree/bits/literals.hxx
+++ b/libxsd/xsd/cxx/tree/bits/literals.hxx
@@ -173,6 +173,84 @@ namespace xsd
template <typename C>
const C*
gmonth_prefix ();
+
+ // Exception and diagnostics string literals.
+ //
+ template <typename C>
+ const C*
+ ex_error_error (); // " error: "
+
+ template <typename C>
+ const C*
+ ex_error_warning (); // " warning: "
+
+ template <typename C>
+ const C*
+ ex_parsing_msg (); // "instance document parsing failed"
+
+ template <typename C>
+ const C*
+ ex_eel_expected (); // "expected element '"
+
+ template <typename C>
+ const C*
+ ex_uel_expected (); // "expected element '"
+
+ template <typename C>
+ const C*
+ ex_uel_instead (); // "' instead of '"
+
+ template <typename C>
+ const C*
+ ex_uel_unexpected (); // "unexpected element '"
+
+ template <typename C>
+ const C*
+ ex_eat_expected (); // "expected attribute '"
+
+ template <typename C>
+ const C*
+ ex_uen_unexpected (); // "unexpected enumerator '"
+
+ template <typename C>
+ const C*
+ ex_etc_msg (); // "expected text content"
+
+ template <typename C>
+ const C*
+ ex_nti_no_type_info (); // "no type information available for type '"
+
+ template <typename C>
+ const C*
+ ex_nei_no_element_info (); // "no parsing or serialization information
+ // available for element '"
+ template <typename C>
+ const C*
+ ex_nd_type (); // "type '"
+
+ template <typename C>
+ const C*
+ ex_nd_not_derived (); // "' is not derived from '"
+
+ template <typename C>
+ const C*
+ ex_di_id (); // "ID '"
+
+ template <typename C>
+ const C*
+ ex_di_already_exist (); // "' already exist"
+
+ template <typename C>
+ const C*
+ ex_serialization_msg (); // "serialization failed"
+
+ template <typename C>
+ const C*
+ ex_npm_no_mapping (); // "no mapping provided for namespace prefix '"
+
+ template <typename C>
+ const C*
+ ex_bounds_msg (); // "buffer boundary rules have been violated"
}
}
}
diff --git a/libxsd/xsd/cxx/tree/bits/literals.ixx b/libxsd/xsd/cxx/tree/bits/literals.ixx
index bd6fd30..e11bcac 100644
--- a/libxsd/xsd/cxx/tree/bits/literals.ixx
+++ b/libxsd/xsd/cxx/tree/bits/literals.ixx
@@ -306,6 +306,141 @@ namespace xsd
{
return "--";
}
+
+ //
+ //
+ template <>
+ inline const char*
+ ex_error_error ()
+ {
+ return " error: ";
+ }
+
+ template <>
+ inline const char*
+ ex_error_warning ()
+ {
+ return " warning: ";
+ }
+
+ template <>
+ inline const char*
+ ex_parsing_msg ()
+ {
+ return "instance document parsing failed";
+ }
+
+ template <>
+ inline const char*
+ ex_eel_expected ()
+ {
+ return "expected element '";
+ }
+
+ template <>
+ inline const char*
+ ex_uel_expected ()
+ {
+ return "expected element '";
+ }
+
+ template <>
+ inline const char*
+ ex_uel_instead ()
+ {
+ return "' instead of '";
+ }
+
+ template <>
+ inline const char*
+ ex_uel_unexpected ()
+ {
+ return "unexpected element '";
+ }
+
+ template <>
+ inline const char*
+ ex_eat_expected ()
+ {
+ return "expected attribute '";
+ }
+
+ template <>
+ inline const char*
+ ex_uen_unexpected ()
+ {
+ return "unexpected enumerator '";
+ }
+
+ template <>
+ inline const char*
+ ex_etc_msg ()
+ {
+ return "expected text content";
+ }
+
+ template <>
+ inline const char*
+ ex_nti_no_type_info ()
+ {
+ return "no type information available for type '";
+ }
+
+ template <>
+ inline const char*
+ ex_nei_no_element_info ()
+ {
+ return "no parsing or serialization information available for "
+ "element '";
+ }
+ template <>
+ inline const char*
+ ex_nd_type ()
+ {
+ return "type '";
+ }
+
+ template <>
+ inline const char*
+ ex_nd_not_derived ()
+ {
+ return "' is not derived from '";
+ }
+
+ template <>
+ inline const char*
+ ex_di_id ()
+ {
+ return "ID '";
+ }
+
+ template <>
+ inline const char*
+ ex_di_already_exist ()
+ {
+ return "' already exist";
+ }
+
+ template <>
+ inline const char*
+ ex_serialization_msg ()
+ {
+ return "serialization failed";
+ }
+
+ template <>
+ inline const char*
+ ex_npm_no_mapping ()
+ {
+ return "no mapping provided for namespace prefix '";
+ }
+
+ template <>
+ inline const char*
+ ex_bounds_msg ()
+ {
+ return "buffer boundary rules have been violated";
+ }
}
}
}
@@ -597,6 +732,141 @@ namespace xsd
{
return L"--";
}
+
+ //
+ //
+ template <>
+ inline const wchar_t*
+ ex_error_error ()
+ {
+ return L" error: ";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_error_warning ()
+ {
+ return L" warning: ";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_parsing_msg ()
+ {
+ return L"instance document parsing failed";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_eel_expected ()
+ {
+ return L"expected element '";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_uel_expected ()
+ {
+ return L"expected element '";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_uel_instead ()
+ {
+ return L"' instead of '";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_uel_unexpected ()
+ {
+ return L"unexpected element '";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_eat_expected ()
+ {
+ return L"expected attribute '";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_uen_unexpected ()
+ {
+ return L"unexpected enumerator '";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_etc_msg ()
+ {
+ return L"expected text content";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_nti_no_type_info ()
+ {
+ return L"no type information available for type '";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_nei_no_element_info ()
+ {
+ return L"no parsing or serialization information available for "
+ L"element '";
+ }
+ template <>
+ inline const wchar_t*
+ ex_nd_type ()
+ {
+ return L"type '";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_nd_not_derived ()
+ {
+ return L"' is not derived from '";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_di_id ()
+ {
+ return L"ID '";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_di_already_exist ()
+ {
+ return L"' already exist";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_serialization_msg ()
+ {
+ return L"serialization failed";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_npm_no_mapping ()
+ {
+ return L"no mapping provided for namespace prefix '";
+ }
+
+ template <>
+ inline const wchar_t*
+ ex_bounds_msg ()
+ {
+ return L"buffer boundary rules have been violated";
+ }
}
}
}