1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
|
// file : xsd/cxx/tree/options.cli
// author : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
include <cstddef>; // std::size_t
include <types.hxx>; // NarrowString, NarrowStrings
include <cxx/options.cli>;
namespace CXX
{
namespace Tree
{
class options: CXX::options
{
// Polymorphism.
//
bool --generate-polymorphic
{
"Generate polymorphism-aware code. Specify this option if you use
substitution groups or \cb{xsi:type}. Use the \cb{--polymorphic-type}
or \cb{--polymorphic-type-all} option to specify which type
hierarchies are polymorphic."
};
NarrowStrings --polymorphic-type
{
"<type>",
"Indicate that <type> is a root of a polymorphic type hierarchy. The
compiler can often automatically determine which types are
polymorphic based on the substitution group declarations. However,
you may need to use this option if you are not using substitution
groups or if substitution groups are defined in another schema. You
need to specify this option when compiling every schema file that
references <type>. The <type> argument is an XML Schema type name
that can be optionally qualified with a namespace in the
\c{\i{namespace}\b{#}\i{name}} form."
};
bool --polymorphic-type-all
{
"Indicate that all types should be treated as polymorphic."
};
// Features.
//
bool --generate-serialization
{
"Generate serialization functions. Serialization functions convert
the object model back to XML."
};
bool --generate-ostream
{
"Generate ostream insertion operators (\cb{operator<<}) for generated
types. This allows one to easily print a fragment or the whole object
model for debugging or logging."
};
bool --generate-doxygen
{
"Generate documentation comments suitable for extraction by the
Doxygen documentation system. Documentation from annotations is
added to the comments if present in the schema."
};
bool --generate-comparison
{
"Generate comparison operators (\cb{operator==} and \cb{operator!=})
for complex types. Comparison is performed member-wise."
};
bool --generate-default-ctor
{
"Generate default constructors even for types that have required
members. Required members of an instance constructed using such a
constructor are not initialized and accessing them results in
undefined behavior."
};
bool --generate-from-base-ctor
{
"Generate constructors that expect an instance of a base type
followed by all required members."
};
bool --suppress-assignment
{
"Suppress the generation of copy assignment operators for complex
types. If this option is specified, the copy assignment operators
for such types are declared private and left unimplemented."
};
bool --generate-detach
{
"Generate detach functions for required elements and attributes.
Detach functions for optional and sequence cardinalities are
provided by the respective containers. These functions, for
example, allow you to move sub-trees in the object model either
within the same tree or between different trees."
};
bool --generate-wildcard
{
"Generate accessors and modifiers as well as parsing and serialization
code for XML Schema wildcards (\cb{any} and \cb{anyAttribute}). XML
content matched by wildcards is presented as DOM fragments. Note
that you need to initialize the Xerces-C++ runtime if you are using
this option."
};
NarrowStrings --generate-insertion
{
"<os>",
"Generate data representation stream insertion operators for the <os>
output stream type. Repeat this option to specify more than one
stream type. The ACE CDR stream (\cb{ACE_OutputCDR}) and RPC XDR
are recognized by the compiler and the necessary \cb{#include}
directives are automatically generated. For custom stream types use
the \cb{--hxx-prologue*} options to provide the necessary
declarations."
};
NarrowStrings --generate-extraction
{
"<is>",
"Generate data representation stream extraction constructors for the
<is> input stream type. Repeat this option to specify more than one
stream type. The ACE CDR stream (\cb{ACE_InputCDR}) and RPC XDR are
recognized by the compiler and the necessary \cb{#include} directives
are automatically generated. For custom stream types use the
\cb{--hxx-prologue*} options to provide the necessary declarations."
};
bool --generate-forward
{
"Generate a separate header file with forward declarations for the
types being generated."
};
bool --suppress-parsing
{
"Suppress the generation of the parsing functions and constructors.
Use this option to reduce the generated code size when parsing from
XML is not needed."
};
bool --generate-element-type
{
"Generate types instead of parsing and serialization functions for
root elements. This is primarily useful to distinguish object models
with the same root type but with different root elements."
};
bool --generate-element-map
{
"Generate a root element map that allows uniform parsing and
serialization of multiple root elements. This option is only valid
together with \cb{--generate-element-type}."
};
bool --generate-intellisense
{
"Generate workarounds for IntelliSense bugs in Visual Studio 2005
(8.0). When this option is used, the resulting code is slightly
more verbose. IntelliSense in Visual Studio 2008 (9.0) and later
does not require these workarounds. Support for IntelliSense in
Visual Studio 2003 (7.1) is improved with this option but is
still incomplete."
};
bool --omit-default-attributes
{
"Omit attributes with default and fixed values from serialized XML
documents."
};
// Naming.
//
NarrowString --type-naming = "knr"
{
"<style>",
"Specify the type naming convention that should be used in the
generated code. Valid styles are \cb{knr} (default), \cb{ucc},
and \cb{java}. See the NAMING CONVENTION section below for more
information."
};
NarrowString --function-naming = "knr"
{
"<style>",
"Specify the function naming convention that should be used in the
generated code. Valid styles are \cb{knr} (default), \cb{lcc}, and
\cb{java}. See the NAMING CONVENTION section below for more
information."
};
NarrowStrings --type-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema type names to C++ type names. See the NAMING CONVENTION
section below for more information."
};
NarrowStrings --accessor-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema names of elements/attributes to C++ accessor function
names. See the NAMING CONVENTION section below for more information."
};
NarrowStrings --one-accessor-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema names of elements/attributes with cardinality one to
C++ accessor function names. See the NAMING CONVENTION section
below for more information."
};
NarrowStrings --opt-accessor-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema names of elements/attributes with cardinality optional
to C++ accessor function names. See the NAMING CONVENTION section
below for more information."
};
NarrowStrings --seq-accessor-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema names of elements/attributes with cardinality sequence
to C++ accessor function names. See the NAMING CONVENTION section
below for more information."
};
NarrowStrings --modifier-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema names of elements/attributes to C++ modifier function
names. See the NAMING CONVENTION section below for more information."
};
NarrowStrings --one-modifier-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema names of elements/attributes with cardinality one to C++
modifier function names. See the NAMING CONVENTION section below
for more information."
};
NarrowStrings --opt-modifier-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema names of elements/attributes with cardinality optional
to C++ modifier function names. See the NAMING CONVENTION section
below for more information."
};
NarrowStrings --seq-modifier-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema names of elements/attributes with cardinality sequence
to C++ modifier function names. See the NAMING CONVENTION section
below for more information."
};
NarrowStrings --parser-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema element names to C++ parsing function names. See the
NAMING CONVENTION section below for more information."
};
NarrowStrings --serializer-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema element names to C++ serialization function names. See
the NAMING CONVENTION section below for more information."
};
NarrowStrings --enumerator-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema enumeration values to C++ enumerator names. See the
NAMING CONVENTION section below for more information."
};
NarrowStrings --element-type-regex
{
"<regex>",
"Add <regex> to the list of regular expressions used to translate
XML Schema element names to C++ element type names. See the NAMING
CONVENTION section below for more information."
};
bool --name-regex-trace
{
"Trace the process of applying regular expressions specified with
the name transformation options. Use this option to find out why
your regular expressions don't do what you expected them to do."
};
// Root element.
//
bool --root-element-first
{
"Treat only the first global element as a document root. By default
all global elements are considered document roots."
};
bool --root-element-last
{
"Treat only the last global element as a document root. By default
all global elements are considered document roots."
};
bool --root-element-all
{
"Treat all global elements as document roots. This is the default
behavior. By explicitly specifying this option you can suppress
the warning that is issued if more than one global element is
defined."
};
bool --root-element-none
{
"Do not treat any global elements as document roots. By default all
global elements are considered document roots."
};
NarrowStrings --root-element
{
"<element>",
"Treat only <element> as a document root. Repeat this option to
specify more than one root element."
};
// Custom type.
//
NarrowStrings --custom-type
{
"<map>",
"Use a custom C++ type instead of the generated class. The <map>
argument is in the form \c{\i{name}[\b{=}\i{type}[\b{/}\i{base}]]},
where \i{name} is a type name as defined in XML Schema and \i{type}
is a C++ type name that should be used instead. If \i{type} is not
present or empty then the custom type is assumed to have the same
name and be defined in the same namespace as the generated class
would have. If \i{base} is specified then the generated class is
still generated but with that name."
};
NarrowStrings --custom-type-regex
{
"<regex>",
"Use custom C++ types instead of the generated classes. The <regex>
argument is in the form
\c{\b{/}\i{name-pat}\b{/}[\i{type-sub}\b{/}[\i{base-sub}\b{/}]]},
where \i{name-pat} is a regex pattern that will be matched against
type names as defined in XML Schema and \i{type-sub} is a C++ type
name substitution that should be used instead. If \i{type-sub} is
not present or its substitution results in an empty string then
the custom type is assumed to have the same name and be defined
in the same namespace as the generated class would have. If
\i{base-sub} is present and its substitution results in a
non-empty string then the generated class is still generated
but with the result of this substitution as its name. The pattern
and substitutions are in the Perl regular expression format.
See also the REGEX AND SHELL QUOTING section below."
};
// Parts.
//
std::size_t --parts = 1
{
"<num>",
"Split generated source code into <num> parts. This is useful when
translating large, monolithic schemas and a C++ compiler is not
able to compile the resulting source code at once (usually due
to insufficient memory)."
};
NarrowString --parts-suffix = "-"
{
"<suffix>",
"Use <suffix> instead of the default '\cb{-}' to separate the file
name from the part number."
};
};
}
}
|