From 28f737a15d9ce5d9e8b06ab768ef858c07ae510e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 5 Sep 2023 15:20:13 +0300 Subject: Make c++11 value default for xsd --std option Also add support for c++14, c++17, c++20, and c++23 values and drop passing --std option in tests and examples. --- xsd/doc/cxx/parser/guide/index.xhtml.in | 19 +++++++++---------- xsd/doc/cxx/tree/guide/index.xhtml.in | 14 ++++++-------- 2 files changed, 15 insertions(+), 18 deletions(-) (limited to 'xsd/doc/cxx') diff --git a/xsd/doc/cxx/parser/guide/index.xhtml.in b/xsd/doc/cxx/parser/guide/index.xhtml.in index 96d06e2..119f421 100644 --- a/xsd/doc/cxx/parser/guide/index.xhtml.in +++ b/xsd/doc/cxx/parser/guide/index.xhtml.in @@ -553,7 +553,7 @@

-$ xsd cxx-parser --std c++11 --xml-parser expat hello.xsd
+$ xsd cxx-parser --xml-parser expat hello.xsd
   

The --xml-parser option indicates that we want to @@ -1494,7 +1494,7 @@ gender ::gender ::gender; option to let the XSD compiler know about our type map:

-$ xsd cxx-parser --std c++11 --type-map people.map people.xsd
+$ xsd cxx-parser --type-map people.map people.xsd
   

If we now look at the generated people-pskel.hxx, @@ -1673,10 +1673,10 @@ namespace http://www.w3.org/2001/XMLSchema QName xml_schema::qname; - base64Binary std::[auto|unique]_ptr<xml_schema::buffer> - std::[auto|unique]_ptr<xml_schema::buffer>; - hexBinary std::[auto|unique]_ptr<xml_schema::buffer> - std::[auto|unique]_ptr<xml_schema::buffer>; + base64Binary std::[unique|auto]_ptr<xml_schema::buffer> + std::[unique|auto]_ptr<xml_schema::buffer>; + hexBinary std::[unique|auto]_ptr<xml_schema::buffer> + std::[unique|auto]_ptr<xml_schema::buffer>; date xml_schema::date; dateTime xml_schema::date_time; @@ -1742,8 +1742,7 @@ people ::people; recompile our schema and move on to implementing the parsers:

-$ xsd cxx-parser --std c++11 --xml-parser expat --type-map people.map \
-      people.xsd
+$ xsd cxx-parser --xml-parser expat --type-map people.map people.xsd
   

Here is the implementation of our three parsers in full. One @@ -2608,14 +2607,14 @@ private: base64Binary base64_binary_pimpl - std::[auto|unique]_ptr< xml_schema::buffer>
+ std::[unique|auto]_ptr< xml_schema::buffer>
Section 6.3, "base64Binary and hexBinary Parsers" hexBinary hex_binary_pimpl - std::[auto|unique]_ptr< xml_schema::buffer>
+ std::[unique|auto]_ptr< xml_schema::buffer>
Section 6.3, "base64Binary and hexBinary Parsers" diff --git a/xsd/doc/cxx/tree/guide/index.xhtml.in b/xsd/doc/cxx/tree/guide/index.xhtml.in index b704e50..2f7f1e2 100644 --- a/xsd/doc/cxx/tree/guide/index.xhtml.in +++ b/xsd/doc/cxx/tree/guide/index.xhtml.in @@ -536,7 +536,7 @@

-$ xsd cxx-tree --std c++11 hello.xsd
+$ xsd cxx-tree hello.xsd
   

The XSD compiler produces two C++ files: hello.hxx and @@ -633,7 +633,7 @@ hello (std::istream&); select C++98:

-$ xsd cxx-tree hello.xsd
+$ xsd cxx-tree --std c++98 hello.xsd
   

Then the parsing function signatures will become:

@@ -726,7 +726,7 @@ Hello, world! it with the --generate-serialization options:

-$ xsd cxx-tree --std c++11 --generate-serialization hello.xsd
+$ xsd cxx-tree --generate-serialization hello.xsd
   

If we now examine the generated hello.hxx file, @@ -911,7 +911,7 @@ main (int argc, char* argv[]) change the type naming scheme:

-$ xsd cxx-tree --std c++11 --type-naming ucc hello.xsd
+$ xsd cxx-tree --type-naming ucc hello.xsd
   

The ucc argument to the --type-naming @@ -978,8 +978,7 @@ hello (std::istream&); --type-regex option:

-$ xsd cxx-tree --std c++11 --type-naming ucc \
-      --type-regex '/ (.+)_t/\u$1/' hello.xsd
+$ xsd cxx-tree --type-naming ucc --type-regex '/ (.+)_t/\u$1/' hello.xsd
   

This results in the following changes to the generated code:

@@ -1114,8 +1113,7 @@ hello (std::istream&); our schema with the --generate-doxygen option:

-$ xsd cxx-tree --std c++11 --generate-serialization --generate-doxygen \
-      hello.xsd
+$ xsd cxx-tree --generate-serialization --generate-doxygen hello.xsd
   

Now the generated hello.hxx file contains comments -- cgit v1.1