BDE 4.39.x Production Release
Loading...
Searching...
No Matches
balxml_encodingstyle.h
Go to the documentation of this file.
1/// @file balxml_encodingstyle.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// balxml_encodingstyle.h *DO NOT EDIT* @generated -*-C++-*-
8#ifndef INCLUDED_BALXML_ENCODINGSTYLE
9#define INCLUDED_BALXML_ENCODINGSTYLE
10
11#include <bsls_ident.h>
12BSLS_IDENT_RCSID(balxml_encodingstyle_h,"$Id$ $CSID$")
14
15/// @defgroup balxml_encodingstyle balxml_encodingstyle
16/// @brief Provide value-semantic attribute classes
17/// @addtogroup bal
18/// @{
19/// @addtogroup balxml
20/// @{
21/// @addtogroup balxml_encodingstyle
22/// @{
23///
24/// <h1> Outline </h1>
25/// * <a href="#balxml_encodingstyle-purpose"> Purpose</a>
26///
27/// # Purpose {#balxml_encodingstyle-purpose}
28/// Provide value-semantic attribute classes
29/// @}
30/** @} */
31/** @} */
32
33/** @addtogroup bal
34 * @{
35 */
36/** @addtogroup balxml
37 * @{
38 */
39/** @addtogroup balxml_encodingstyle
40 * @{
41 */
42
43#include <bslalg_typetraits.h>
44
45#include <bdlat_attributeinfo.h>
46
48
49#include <bdlat_typetraits.h>
50
51#include <bsls_assert.h>
52
53#include <bsl_iosfwd.h>
54#include <bsl_limits.h>
55
56#include <bsl_ostream.h>
57#include <bsl_string.h>
58
59
60
61namespace balxml {
62
63 // ===================
64 // class EncodingStyle
65 // ===================
66
67/// Enumeration of encoding style (COMPACT or PRETTY).
68/// This struct is generated using bas_codegen.pl called by
69/// balxml/code_from_xsd.pl
70///
71/// See @ref balxml_encodingstyle
73
74 public:
75 // TYPES
76 enum Value {
77 COMPACT = 0
78 , PRETTY = 1
79#ifndef BDE_OMIT_INTERNAL_DEPRECATED
84#endif
85 };
86
87 enum {
89 };
90
91 // CONSTANTS
92 static const char CLASS_NAME[];
93
95
96 // CLASS METHODS
97
98 /// Return the string representation exactly matching the enumerator
99 /// name corresponding to the specified enumeration `value`.
100 static const char *toString(Value value);
101
102 /// Load into the specified `result` the enumerator matching the
103 /// specified `string` of the specified `stringLength`. Return 0 on
104 /// success, and a non-zero value with no effect on `result` otherwise
105 /// (i.e., `string` does not match any enumerator).
106 static int fromString(Value *result,
107 const char *string,
108 int stringLength);
109
110 /// Load into the specified `result` the enumerator matching the
111 /// specified `string`. Return 0 on success, and a non-zero value with
112 /// no effect on `result` otherwise (i.e., `string` does not match any
113 /// enumerator).
114 static int fromString(Value *result,
115 const bsl::string_view& string);
116
117 /// Load into the specified `result` the enumerator matching the
118 /// specified `number`. Return 0 on success, and a non-zero value with
119 /// no effect on `result` otherwise (i.e., `number` does not match any
120 /// enumerator).
121 static int fromInt(Value *result, int number);
122
123 /// Write to the specified `stream` the string representation of
124 /// the specified enumeration `value`. Return a reference to
125 /// the modifiable `stream`.
126 static bsl::ostream& print(bsl::ostream& stream, Value value);
127};
128
129// FREE OPERATORS
130
131/// Format the specified `rhs` to the specified output `stream` and
132/// return a reference to the modifiable `stream`.
133inline
134bsl::ostream& operator<<(bsl::ostream& stream, EncodingStyle::Value rhs);
135
136} // close package namespace
137
138// TRAITS
139
141
142
143// ============================================================================
144// INLINE FUNCTION DEFINITIONS
145// ============================================================================
146
147namespace balxml {
148
149 // -------------------
150 // class EncodingStyle
151 // -------------------
152
153// CLASS METHODS
154inline
156{
157 return fromString(result,
158 string.data(),
159 static_cast<int>(string.length()));
160}
161
162inline
163bsl::ostream& EncodingStyle::print(bsl::ostream& stream,
165{
166 return stream << toString(value);
167}
168
169} // close package namespace
170
171// FREE FUNCTIONS
172
173inline
174bsl::ostream& balxml::operator<<(
175 bsl::ostream& stream,
177{
178 return balxml::EncodingStyle::print(stream, rhs);
179}
180
181
182#endif
183
184// BAS_CODEGEN RUN BY code_from_xsd.pl RUN ON Thu Sep 24 20:40:02 EDT 2020
185// GENERATED BY BLP_BAS_CODEGEN_2020.09.14
186// USING bas_codegen.pl -m msg -p balxml -E --noExternalization --noAggregateConversion --noHashSupport balxml.xsd
187
188// ----------------------------------------------------------------------------
189// Copyright 2020 Bloomberg Finance L.P.
190//
191// Licensed under the Apache License, Version 2.0 (the "License");
192// you may not use this file except in compliance with the License.
193// You may obtain a copy of the License at
194//
195// http://www.apache.org/licenses/LICENSE-2.0
196//
197// Unless required by applicable law or agreed to in writing, software
198// distributed under the License is distributed on an "AS IS" BASIS,
199// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200// See the License for the specific language governing permissions and
201// limitations under the License.
202// ----------------------------- END-OF-FILE ----------------------------------
203
204/** @} */
205/** @} */
206/** @} */
Definition bslstl_stringview.h:471
#define BDLAT_DECL_ENUMERATION_TRAITS(ClassName)
Definition bdlat_typetraits.h:312
#define BSLS_IDENT_RCSID(tag, str)
BSLS_IDENT_RCSID() - insert ident str (specific to platform/compiler)
Definition bsls_ident.h:244
#define BSLS_IDENT_PRAGMA_ONCE
BSLS_IDENT_PRAGMA_ONCE - macro to avoid multiple inclusion
Definition bsls_ident.h:263
Definition balxml_base64parser.h:150
bsl::ostream & operator<<(bsl::ostream &stream, const ConfigSchema &schema)
Definition balxml_encodingstyle.h:72
static bsl::ostream & print(bsl::ostream &stream, Value value)
Definition balxml_encodingstyle.h:163
Value
Definition balxml_encodingstyle.h:76
@ BAEXML_PRETTY
Definition balxml_encodingstyle.h:83
@ e_PRETTY
Definition balxml_encodingstyle.h:81
@ BAEXML_COMPACT
Definition balxml_encodingstyle.h:82
@ PRETTY
Definition balxml_encodingstyle.h:78
@ e_COMPACT
Definition balxml_encodingstyle.h:80
@ COMPACT
Definition balxml_encodingstyle.h:77
static const char * toString(Value value)
static const char CLASS_NAME[]
Definition balxml_encodingstyle.h:92
@ NUM_ENUMERATORS
Definition balxml_encodingstyle.h:88
static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]
Definition balxml_encodingstyle.h:94
static int fromString(Value *result, const char *string, int stringLength)
static int fromInt(Value *result, int number)
Definition bdlat_enumeratorinfo.h:99