aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx/hybrid/options.cli
blob: 64ae2fd8a3b27daa2c4fe0d04cbd9ca29cadc05c (plain)
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
// file      : xsde/cxx/hybrid/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 Hybrid
  {
    class options: CXX::options
    {
      // Features.
      //
      bool --generate-parser
      {
        "Generate XML parsing code."
      };

      bool --generate-serializer
      {
        "Generate XML serialization code."
      };

      bool --generate-aggregate
      {
        "Generate parser/serializer aggregates for root elements and/or types.
         See also the \cb{--root-element-*} and \cb{--root-type} options."
      };

      bool --suppress-validation
      {
        "Suppress the generation of validation code in parser and serializer."
      };

      bool --suppress-parser-val
      {
        "Suppress the generation of validation code in parser."
      };

      bool --suppress-serializer-val
      {
        "Suppress the generation of validation code in serializer."
      };

      bool --omit-default-attributes
      {
        "Omit attributes with default and fixed values from serialized
         XML documents."
      };

      bool --suppress-enum
      {
        "Suppress the generation of the XML Schema enumeration to C++
         \cb{enum} mapping."
      };

      bool --generate-clone
      {
        "Generate clone functions for variable-length types. These
         functions allow you to make dynamically-allocated copies of
         variable-length objects."
      };

      bool --generate-detach
      {
        "Generate detach functions for elements and attributes of
         variable-length types. These functions, for example, allow
         you to move sub-trees in the object model either within the
         same tree or between different trees."
      };

      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 special \cb{CDR} and \cb{XDR} arguments are
         recognized as ACE CDR and Sun RPC XDR stream types and the
         corresponding stream wrappers provided by the XSD/e runtime are
         automatically used. For custom stream types use the
         \cb{--hxx-prologue*} options to include the necessary declarations."
      };

      NarrowStrings --generate-extraction
      {
        "<is>",
        "Generate data representation stream extraction operators for the
         <is> input stream type. Repeat this option to specify more than
         one stream type. The special \cb{CDR} and \cb{XDR} arguments are
         recognized as ACE CDR and Sun RPC XDR stream types and the
         corresponding stream wrappers provided by the XSD/e runtime are
         automatically used. For custom stream types use the
         \cb{--hxx-prologue*} options to include the necessary declarations."
      };

      bool --generate-forward
      {
        "Generate forward declaration file."
      };

      // 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}
         option to specify which type hierarchies are polymorphic."
      };

      bool --runtime-polymorphic
      {
        "Generate non-polymorphic code that uses the runtime library
         configured with polymorphism support."
      };

      NarrowStrings --polymorphic-type
      {
        "<type>",
        "Indicate that <type> is a root of a polymorphic type hierarchy. The
         XSD/e 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>."
      };

      bool --generate-typeinfo
      {
        "Generate custom type information querying functions for polymorphic
         object model types. These functions can be used instead of the
         standard C++ RTTI mechanism to determine object's type at runtime."
      };

      NarrowStrings --polymorphic-schema
      {
        "<file>",
        "Indicate that <file> contains derivations of polymorphic types that
         are not otherwise visible from the schema being compiled. This
         option is used to make sure that during the generation of parser
         and serializer aggregates the compiler is aware of all possible
         derivations of polymorphic types. Repeat this option to specify
         more than one schema file."
      };

      // Reuse style.
      //
      bool --reuse-style-mixin
      {
        "Generate code that supports the mixin base parser/serializer
         implementation reuse style. Note that this reuse style relies on
         virtual inheritance and may result in a substantial object code
         size increase for large vocabularies. By default the tiein reuse
         style is used."
      };

      // Custom data/type.
      //
      NarrowStrings --custom-data
      {
        "<type>",
        "Add the ability to store custom data to the C++ class generated for
         XML Schema type <type>. To add custom data to a nested compositor
         class use the qualified name starting from the XML Schema type
         containing the compositor, for example, \cb{foo::sequence::choise1}."
      };

      NarrowStrings --custom-type
      {
        "<map>",
        "Use a custom type implementation instead of the generated version.
         The <map> argument is in the form
         \c{\i{name}[\b{=}[\i{flags}][\b{/}[\i{type}][\b{/}[\i{base}][\b{/}\i{include}]]]]},
         where the \ci{name} component is the XML Schema type name being
         customized. Optional \ci{flags} allow you to specify whether the
         custom type is fixed or variable-length. The \cb{f} flag indicates
         the type is fixed-length and the \cb{v} flag indicates the type is
         variable-length. If omitted, the default rules are used to determine
         the type length. Optional \ci{type} is a C++ type name that should
         be used instead. If specified, the object model type is defined as
         a \cb{typedef} alias for this C++ type. Optional \ci{base} is a C++
         name that should be given to the generated version. It is normally
         used as a base for the custom implementation. Optional \ci{include}
         is the header file that defines the custom implementation. It is
         \cb{#include}'ed into the generated code immediately after (if
         \ci{base} is specified) or instead of the generated version."
      };

      NarrowStrings --custom-parser
      {
        "<map>",
        "Use a custom parser implementation instead of the generated version.
         The <map> argument is in the form
         \c{\i{name}[\b{=}[\i{base}][\b{/}\i{include}]]}, where the \ci{name}
         component is the XML Schema type name being customized. Optional
         \ci{base} is a C++ name that should be given to the generated
         version. It is normally used as a base for the custom implementation.
         Optional \ci{include} is the header file that defines the custom
         implementation. It is \cb{#include}'ed into the generated code
         immediately after (if \ci{base} is specified) or instead of the
         generated version."
      };

      NarrowStrings --custom-serializer
      {
        "<map>",
        "Use a custom serializer implementation instead of the generated
         version. The <map> argument is in the form
         \c{\i{name}[\b{=}[\i{base}][\b{/}\i{include}]]}, where The \ci{name}
         component is the XML Schema type name being customized. Optional
         \ci{base} is a C++ name that should be given to the generated
         version. It is normally used as a base for the custom implementation.
         Optional \ci{include} is the header file that defines the custom
         implementation. It is \cb{#include}'ed into the generated code
         immediately after (if \ci{base} is specified) or instead of the
         generated version."
      };

      // Root element/type.
      //

      bool --root-element-first
      {
        "Treat only the first global element as a document root. This
         determines for which elements parser and serializer aggregates
         are generated. By default all global elements are considered
         document roots. See also the \cb{--generate-aggregate} option."
      };

      bool --root-element-last
      {
        "Treat only the last global element as a document root. This
         determines for which elements parser and serializer aggregates
         are generated. By default all global elements are considered
         document roots. See also the \cb{--generate-aggregate} option."
      };

      bool --root-element-all
      {
        "Treat all global elements as document roots (the default behavior).
         This determines for which elements parser and serializer aggregates
         are generated. By explicitly specifying this option you can suppress
         the warning that is issued if more than one global element is
         defined. See also the \cb{--generate-aggregate} option."
      };

      bool --root-element-none
      {
        "Do not treat any global elements as document roots. This determines
         for which elements parser and serializer aggregates are generated.
         By default all global elements are considered document roots. See
         also the \cb{--generate-aggregate} option."
      };

      NarrowStrings --root-element
      {
        "<element>",
        "Treat only <element> as a document root. This determines for which
         elements parser and serializer aggregates are generated. Repeat
         this option to specify more than one root element. See also the
         \cb{--generate-aggregate} option."
      };

      NarrowStrings --root-type
      {
        "<type>",
        "Generate parser/serializer aggregate for <type>. Repeat this option
         to specify more than one type. See also the \cb{--generate-aggregate}
         option."
      };

      // Suffixes.
      //
      NarrowString --pskel-type-suffix = "_pskel"
      {
        "<suffix>",
        "Use <suffix> instead of the default \cb{_pskel} to construct the
         names of generated parser skeletons."
      };

      NarrowString --sskel-type-suffix = "_sskel"
      {
        "<suffix>",
        "Use <suffix> instead of the default \cb{_sskel} to construct the
         names of generated serializer skeletons."
      };

      NarrowString --pskel-file-suffix = "-pskel"
      {
        "<suffix>",
        "Use <suffix> instead of the default \cb{-pskel} to construct the
         names of generated parser skeleton files."
      };

      NarrowString --sskel-file-suffix = "-sskel"
      {
        "<suffix>",
        "Use <suffix> instead of the default \cb{-sskel} to construct the
         names of generated serializer skeleton files."
      };

      NarrowString --pimpl-type-suffix = "_pimpl"
      {
        "<suffix>",
        "Use <suffix> instead of the default \cb{_pimpl} to construct the
         names of generated parser implementations."
      };

      NarrowString --simpl-type-suffix = "_simpl"
      {
        "<suffix>",
        "Use <suffix> instead of the default \cb{_simpl} to construct the
         names of generated serializer implementations."
      };

      NarrowString --pimpl-file-suffix = "-pimpl"
      {
        "<suffix>",
        "Use <suffix> instead of the default \cb{-pimpl} to construct the
         names of generated parser implementation files."
      };

      NarrowString --simpl-file-suffix = "-simpl"
      {
        "<suffix>",
        "Use <suffix> instead of the default \cb{-simpl} to construct the
         names of generated serializer implementation files."
      };

      NarrowString --paggr-type-suffix = "_paggr"
      {
        "<suffix>",
        "Use <suffix> instead of the default \cb{_paggr} to construct the
         names of generated parser aggregates."
      };

      NarrowString --saggr-type-suffix = "_saggr"
      {
        "<suffix>",
        "Use <suffix> instead of the default \cb{_saggr} to construct the
         names of generated serializer aggregates."
      };

      // In C++/Hybrid these common options can be specified multiple
      // times with keys that identify which files they apply to. So
      // "override" them here. Note that the documentation is still
      // specified in the common version.
      //
      NarrowStrings --hxx-regex;
      NarrowStrings --ixx-regex;
      NarrowStrings --cxx-regex;

      NarrowStrings --hxx-prologue-file;
      NarrowStrings --ixx-prologue-file;
      NarrowStrings --cxx-prologue-file;
      NarrowStrings --prologue-file;
      NarrowStrings --hxx-epilogue-file;
      NarrowStrings --ixx-epilogue-file;
      NarrowStrings --cxx-epilogue-file;
      NarrowStrings --epilogue-file;
    };
  }
}