diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2023-09-05 15:20:13 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2023-09-06 11:44:16 +0300 |
commit | 28f737a15d9ce5d9e8b06ab768ef858c07ae510e (patch) | |
tree | 7523a801d1326a6e8ba0646d8d4b927f1eaa608b /xsd/doc | |
parent | 0c40310afde1d595697d0edfb3b174a9738605cf (diff) |
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.
Diffstat (limited to 'xsd/doc')
-rw-r--r-- | xsd/doc/cxx/parser/guide/index.xhtml.in | 19 | ||||
-rw-r--r-- | xsd/doc/cxx/tree/guide/index.xhtml.in | 14 | ||||
-rw-r--r-- | xsd/doc/pregenerated/xsd.1 | 22 | ||||
-rw-r--r-- | xsd/doc/pregenerated/xsd.xhtml | 22 | ||||
-rw-r--r-- | xsd/doc/xsd-epilogue.1 | 17 | ||||
-rw-r--r-- | xsd/doc/xsd-epilogue.xhtml | 14 |
6 files changed, 66 insertions, 42 deletions
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 @@ </p> <pre class="terminal"> -$ xsd cxx-parser --std c++11 --xml-parser expat hello.xsd +$ xsd cxx-parser --xml-parser expat hello.xsd </pre> <p>The <code>--xml-parser</code> option indicates that we want to @@ -1494,7 +1494,7 @@ gender ::gender ::gender; option to let the XSD compiler know about our type map:</p> <pre class="terminal"> -$ xsd cxx-parser --std c++11 --type-map people.map people.xsd +$ xsd cxx-parser --type-map people.map people.xsd </pre> <p>If we now look at the generated <code>people-pskel.hxx</code>, @@ -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:</p> <pre class="terminal"> -$ 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 </pre> <p>Here is the implementation of our three parsers in full. One @@ -2608,14 +2607,14 @@ private: <tr> <td><code>base64Binary</code></td> <td><code>base64_binary_pimpl</code></td> - <td><code>std::[auto|unique]_ptr< xml_schema::buffer></code><br/> + <td><code>std::[unique|auto]_ptr< xml_schema::buffer></code><br/> <a href="#6.3">Section 6.3, "<code>base64Binary</code> and <code>hexBinary</code> Parsers"</a></td> </tr> <tr> <td><code>hexBinary</code></td> <td><code>hex_binary_pimpl</code></td> - <td><code>std::[auto|unique]_ptr< xml_schema::buffer></code><br/> + <td><code>std::[unique|auto]_ptr< xml_schema::buffer></code><br/> <a href="#6.3">Section 6.3, "<code>base64Binary</code> and <code>hexBinary</code> Parsers"</a></td> </tr> 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 @@ </p> <pre class="terminal"> -$ xsd cxx-tree --std c++11 hello.xsd +$ xsd cxx-tree hello.xsd </pre> <p>The XSD compiler produces two C++ files: <code>hello.hxx</code> and @@ -633,7 +633,7 @@ hello (std::istream&); select C++98:</p> <pre class="terminal"> -$ xsd cxx-tree hello.xsd +$ xsd cxx-tree --std c++98 hello.xsd </pre> <p>Then the parsing function signatures will become:</p> @@ -726,7 +726,7 @@ Hello, world! it with the <code>--generate-serialization</code> options:</p> <pre class="terminal"> -$ xsd cxx-tree --std c++11 --generate-serialization hello.xsd +$ xsd cxx-tree --generate-serialization hello.xsd </pre> <p>If we now examine the generated <code>hello.hxx</code> file, @@ -911,7 +911,7 @@ main (int argc, char* argv[]) change the type naming scheme:</p> <pre class="terminal"> -$ xsd cxx-tree --std c++11 --type-naming ucc hello.xsd +$ xsd cxx-tree --type-naming ucc hello.xsd </pre> <p>The <code>ucc</code> argument to the <code>--type-naming</code> @@ -978,8 +978,7 @@ hello (std::istream&); <code>--type-regex</code> option:</p> <pre class="terminal"> -$ 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 </pre> <p>This results in the following changes to the generated code:</p> @@ -1114,8 +1113,7 @@ hello (std::istream&); our schema with the <code>--generate-doxygen</code> option:</p> <pre class="terminal"> -$ xsd cxx-tree --std c++11 --generate-serialization --generate-doxygen \ - hello.xsd +$ xsd cxx-tree --generate-serialization --generate-doxygen hello.xsd </pre> <p>Now the generated <code>hello.hxx</code> file contains comments diff --git a/xsd/doc/pregenerated/xsd.1 b/xsd/doc/pregenerated/xsd.1 index 7d2727f..0cf4f6f 100644 --- a/xsd/doc/pregenerated/xsd.1 +++ b/xsd/doc/pregenerated/xsd.1 @@ -119,12 +119,15 @@ if any, should appear after the corresponding . .IP "\fB--std\fR \fIversion\fR" Specify the C++ standard that the generated code should conform to\. Valid -values are \fBc++98\fR (default) and \fBc++11\fR\. +values are \fBc++98\fR, \fBc++11\fR (default), \fBc++14\fR, \fBc++17\fR, +\fBc++20\fR, and \fBc++23\fR\. The C++ standard affects various aspects of the generated code that are discussed in more detail in various mapping-specific documentation\. Overall, when C++11 is selected, the generated code relies on the move semantics and uses \fBstd::unique_ptr\fR instead of deprecated \fBstd::auto_ptr\fR\. +Currently, there is no difference between the C++11 and the later standards +modes\. When the C++11 mode is selected, you normally don't need to perform any extra steps other than enable C++11 in your C++ compiler, if required\. The XSD @@ -1292,7 +1295,6 @@ namespace http://www.example.com/xmlns/my .br .RE - The compiler has a number of predefined mapping rules that can be presented as the following map files. The string-based XML Schema built-in types are mapped to either @@ -1303,6 +1305,14 @@ depending on the character type selected with the .B --char-type option .RB ( char +by default). The binary XML Schema types are mapped to either +.B std::unique_ptr<xml_schema::buffer> +or +.B std::auto_ptr<xml_schema::buffer> +depending on the C++ standard selected with the +.B --std +option +.RB ( c++11 by default). .RS @@ -1382,13 +1392,13 @@ namespace http://www.w3.org/2001/XMLSchema QName xml_schema::qname; .br - base64Binary std::auto_ptr<xml_schema::buffer> + base64Binary std::[unique|auto]_ptr<xml_schema::buffer> .br - std::auto_ptr<xml_schema::buffer>; + std::[unique|auto]_ptr<xml_schema::buffer>; .br - hexBinary std::auto_ptr<xml_schema::buffer> + hexBinary std::[unique|auto]_ptr<xml_schema::buffer> .br - std::auto_ptr<xml_schema::buffer>; + std::[unique|auto]_ptr<xml_schema::buffer>; .br date xml_schema::date; diff --git a/xsd/doc/pregenerated/xsd.xhtml b/xsd/doc/pregenerated/xsd.xhtml index d7d1ee3..ae90b41 100644 --- a/xsd/doc/pregenerated/xsd.xhtml +++ b/xsd/doc/pregenerated/xsd.xhtml @@ -124,14 +124,16 @@ <dl class="options"> <dt><code><b>--std</b></code> <code><i>version</i></code></dt> <dd>Specify the C++ standard that the generated code should conform to. - Valid values are <code><b>c++98</b></code> (default) and - <code><b>c++11</b></code>. + Valid values are <code><b>c++98</b></code>, <code><b>c++11</b></code> + (default), <code><b>c++14</b></code>, <code><b>c++17</b></code>, + <code><b>c++20</b></code>, and <code><b>c++23</b></code>. <p>The C++ standard affects various aspects of the generated code that are discussed in more detail in various mapping-specific documentation. Overall, when C++11 is selected, the generated code relies on the move semantics and uses <code><b>std::unique_ptr</b></code> instead of - deprecated <code><b>std::auto_ptr</b></code>.</p> + deprecated <code><b>std::auto_ptr</b></code>. Currently, there is no + difference between the C++11 and the later standards modes.</p> <p>When the C++11 mode is selected, you normally don't need to perform any extra steps other than enable C++11 in your C++ compiler, if required. The @@ -1465,7 +1467,11 @@ namespace http://www.example.com/xmlns/my built-in types are mapped to either <code><b>std::string</b></code> or <code><b>std::wstring</b></code> depending on the character type selected with the <code><b>--char-type</b></code> option - (<code><b>char</b></code> by default).</p> + (<code><b>char</b></code> by default). The binary XML Schema types are + mapped to either <code>std::unique_ptr<xml_schema::buffer></code> + or <code>std::auto_ptr<xml_schema::buffer></code> depending on the C++ + standard selected with the <code><b>--std</b></code> option + (<code><b>c++11</b></code> by default).</p> <pre> namespace http://www.w3.org/2001/XMLSchema @@ -1512,10 +1518,10 @@ namespace http://www.w3.org/2001/XMLSchema QName xml_schema::qname; - base64Binary std::auto_ptr<xml_schema::buffer> - std::auto_ptr<xml_schema::buffer>; - hexBinary std::auto_ptr<xml_schema::buffer> - std::auto_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; diff --git a/xsd/doc/xsd-epilogue.1 b/xsd/doc/xsd-epilogue.1 index a37da89..9ab1952 100644 --- a/xsd/doc/xsd-epilogue.1 +++ b/xsd/doc/xsd-epilogue.1 @@ -381,7 +381,6 @@ namespace http://www.example.com/xmlns/my .br .RE - The compiler has a number of predefined mapping rules that can be presented as the following map files. The string-based XML Schema built-in types are mapped to either @@ -392,6 +391,14 @@ depending on the character type selected with the .B --char-type option .RB ( char +by default). The binary XML Schema types are mapped to either +.B std::unique_ptr<xml_schema::buffer> +or +.B std::auto_ptr<xml_schema::buffer> +depending on the C++ standard selected with the +.B --std +option +.RB ( c++11 by default). .RS @@ -471,13 +478,13 @@ namespace http://www.w3.org/2001/XMLSchema QName xml_schema::qname; .br - base64Binary std::auto_ptr<xml_schema::buffer> + base64Binary std::[unique|auto]_ptr<xml_schema::buffer> .br - std::auto_ptr<xml_schema::buffer>; + std::[unique|auto]_ptr<xml_schema::buffer>; .br - hexBinary std::auto_ptr<xml_schema::buffer> + hexBinary std::[unique|auto]_ptr<xml_schema::buffer> .br - std::auto_ptr<xml_schema::buffer>; + std::[unique|auto]_ptr<xml_schema::buffer>; .br date xml_schema::date; diff --git a/xsd/doc/xsd-epilogue.xhtml b/xsd/doc/xsd-epilogue.xhtml index 632b2d9..178cf8b 100644 --- a/xsd/doc/xsd-epilogue.xhtml +++ b/xsd/doc/xsd-epilogue.xhtml @@ -290,7 +290,11 @@ namespace http://www.example.com/xmlns/my built-in types are mapped to either <code><b>std::string</b></code> or <code><b>std::wstring</b></code> depending on the character type selected with the <code><b>--char-type</b></code> option - (<code><b>char</b></code> by default).</p> + (<code><b>char</b></code> by default). The binary XML Schema types are + mapped to either <code>std::unique_ptr<xml_schema::buffer></code> + or <code>std::auto_ptr<xml_schema::buffer></code> depending on the C++ + standard selected with the <code><b>--std</b></code> option + (<code><b>c++11</b></code> by default).</p> <pre> namespace http://www.w3.org/2001/XMLSchema @@ -337,10 +341,10 @@ namespace http://www.w3.org/2001/XMLSchema QName xml_schema::qname; - base64Binary std::auto_ptr<xml_schema::buffer> - std::auto_ptr<xml_schema::buffer>; - hexBinary std::auto_ptr<xml_schema::buffer> - std::auto_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; |