From 06e68339a849ab955d7dab169eeb3436edf33cde Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Oct 2021 07:21:20 +0200 Subject: Add base_string() accessor to xml_schema::{string,uri} mapping types --- libxsd/xsd/cxx/tree/types.hxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'libxsd/xsd') diff --git a/libxsd/xsd/cxx/tree/types.hxx b/libxsd/xsd/cxx/tree/types.hxx index 30b2209..0790997 100644 --- a/libxsd/xsd/cxx/tree/types.hxx +++ b/libxsd/xsd/cxx/tree/types.hxx @@ -268,6 +268,18 @@ namespace xsd base () = x; return *this; } + + public: + /** + * @brief Explicitly "cast" to the base string type. + * + * @return A const reference to the instance as the base string type. + */ + const std::basic_string& + base_string () const + { + return *this; + } }; /** @@ -2877,6 +2889,18 @@ namespace xsd return *this; } + public: + /** + * @brief Explicitly "cast" to the base string type. + * + * @return A const reference to the instance as the base string type. + */ + const std::basic_string& + base_string () const + { + return *this; + } + protected: //@cond -- cgit v1.1