BDE 4.14.0 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
71
72 public:
73 // TYPES
74 enum Value {
75 COMPACT = 0
76 , PRETTY = 1
77#ifndef BDE_OMIT_INTERNAL_DEPRECATED
82#endif
83 };
84
85 enum {
87 };
88
89 // CONSTANTS
90 static const char CLASS_NAME[];
91
93
94 // CLASS METHODS
95
96 /// Return the string representation exactly matching the enumerator
97 /// name corresponding to the specified enumeration `value`.
98 static const char *toString(Value value);
99
100 /// Load into the specified `result` the enumerator matching the
101 /// specified `string` of the specified `stringLength`. Return 0 on
102 /// success, and a non-zero value with no effect on `result` otherwise
103 /// (i.e., `string` does not match any enumerator).
104 static int fromString(Value *result,
105 const char *string,
106 int stringLength);
107
108 /// Load into the specified `result` the enumerator matching the
109 /// specified `string`. Return 0 on success, and a non-zero value with
110 /// no effect on `result` otherwise (i.e., `string` does not match any
111 /// enumerator).
112 static int fromString(Value *result,
113 const bsl::string_view& string);
114
115 /// Load into the specified `result` the enumerator matching the
116 /// specified `number`. Return 0 on success, and a non-zero value with
117 /// no effect on `result` otherwise (i.e., `number` does not match any
118 /// enumerator).
119 static int fromInt(Value *result, int number);
120
121 /// Write to the specified `stream` the string representation of
122 /// the specified enumeration `value`. Return a reference to
123 /// the modifiable `stream`.
124 static bsl::ostream& print(bsl::ostream& stream, Value value);
125};
126
127// FREE OPERATORS
128
129/// Format the specified `rhs` to the specified output `stream` and
130/// return a reference to the modifiable `stream`.
131inline
132bsl::ostream& operator<<(bsl::ostream& stream, EncodingStyle::Value rhs);
133
134} // close package namespace
135
136// TRAITS
137
139
140
141// ============================================================================
142// INLINE FUNCTION DEFINITIONS
143// ============================================================================
144
145namespace balxml {
146
147 // -------------------
148 // class EncodingStyle
149 // -------------------
150
151// CLASS METHODS
152inline
154{
155 return fromString(result,
156 string.data(),
157 static_cast<int>(string.length()));
158}
159
160inline
161bsl::ostream& EncodingStyle::print(bsl::ostream& stream,
163{
164 return stream << toString(value);
165}
166
167} // close package namespace
168
169// FREE FUNCTIONS
170
171inline
172bsl::ostream& balxml::operator<<(
173 bsl::ostream& stream,
175{
176 return balxml::EncodingStyle::print(stream, rhs);
177}
178
179
180#endif
181
182// BAS_CODEGEN RUN BY code_from_xsd.pl RUN ON Thu Sep 24 20:40:02 EDT 2020
183// GENERATED BY BLP_BAS_CODEGEN_2020.09.14
184// USING bas_codegen.pl -m msg -p balxml -E --noExternalization --noAggregateConversion --noHashSupport balxml.xsd
185
186// ----------------------------------------------------------------------------
187// Copyright 2020 Bloomberg Finance L.P.
188//
189// Licensed under the Apache License, Version 2.0 (the "License");
190// you may not use this file except in compliance with the License.
191// You may obtain a copy of the License at
192//
193// http://www.apache.org/licenses/LICENSE-2.0
194//
195// Unless required by applicable law or agreed to in writing, software
196// distributed under the License is distributed on an "AS IS" BASIS,
197// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
198// See the License for the specific language governing permissions and
199// limitations under the License.
200// ----------------------------- END-OF-FILE ----------------------------------
201
202/** @} */
203/** @} */
204/** @} */
Definition bslstl_stringview.h:441
#define BDLAT_DECL_ENUMERATION_TRAITS(ClassName)
Definition bdlat_typetraits.h:293
#define BSLS_IDENT_RCSID(tag, str)
Definition bsls_ident.h:260
#define BSLS_IDENT_PRAGMA_ONCE
Definition bsls_ident.h:310
Definition balxml_base64parser.h:150
bsl::ostream & operator<<(bsl::ostream &stream, const ConfigSchema &schema)
Definition balxml_encodingstyle.h:70
static bsl::ostream & print(bsl::ostream &stream, Value value)
Definition balxml_encodingstyle.h:161
Value
Definition balxml_encodingstyle.h:74
@ BAEXML_PRETTY
Definition balxml_encodingstyle.h:81
@ e_PRETTY
Definition balxml_encodingstyle.h:79
@ BAEXML_COMPACT
Definition balxml_encodingstyle.h:80
@ PRETTY
Definition balxml_encodingstyle.h:76
@ e_COMPACT
Definition balxml_encodingstyle.h:78
@ COMPACT
Definition balxml_encodingstyle.h:75
static const char * toString(Value value)
static const char CLASS_NAME[]
Definition balxml_encodingstyle.h:90
@ NUM_ENUMERATORS
Definition balxml_encodingstyle.h:86
static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]
Definition balxml_encodingstyle.h:92
static int fromString(Value *result, const char *string, int stringLength)
static int fromInt(Value *result, int number)
Definition bdlat_enumeratorinfo.h:97