BDE 4.14.0 Production release
Loading...
Searching...
No Matches
s_baltst_myenumeration.h
Go to the documentation of this file.
1/// @file s_baltst_myenumeration.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// s_baltst_myenumeration.h *DO NOT EDIT* @generated -*-C++-*-
8#ifndef INCLUDED_S_BALTST_MYENUMERATION
9#define INCLUDED_S_BALTST_MYENUMERATION
10
11#include <bsls_ident.h>
12BSLS_IDENT_RCSID(s_baltst_myenumeration_h, "$Id$ $CSID$")
14
15/// @defgroup s_baltst_myenumeration s_baltst_myenumeration
16/// @brief Provide value-semantic attribute classes
17/// @addtogroup Standalones
18/// @{
19/// @addtogroup s_baltst
20/// @{
21/// @addtogroup s_baltst_myenumeration
22/// @{
23///
24/// <h1> Outline </h1>
25/// * <a href="#s_baltst_myenumeration-purpose"> Purpose</a>
26///
27/// # Purpose {#s_baltst_myenumeration-purpose}
28/// Provide value-semantic attribute classes
29/// @}
30/** @} */
31/** @} */
32
33/** @addtogroup Standalones
34 * @{
35 */
36/** @addtogroup s_baltst
37 * @{
38 */
39/** @addtogroup s_baltst_myenumeration
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 s_baltst {
62
63 // ===================
64 // class MyEnumeration
65 // ===================
66
68
69 public:
70 // TYPES
71 enum Value {
72 VALUE1 = 0
73 , VALUE2 = 1
74 };
75
76 enum {
78 };
79
80 // CONSTANTS
81 static const char CLASS_NAME[];
82
84
85 // CLASS METHODS
86
87 /// Return the string representation exactly matching the enumerator
88 /// name corresponding to the specified enumeration `value`.
89 static const char *toString(Value value);
90
91 /// Load into the specified `result` the enumerator matching the
92 /// specified `string` of the specified `stringLength`. Return 0 on
93 /// success, and a non-zero value with no effect on `result` otherwise
94 /// (i.e., `string` does not match any enumerator).
95 static int fromString(Value *result,
96 const char *string,
97 int stringLength);
98
99 /// Load into the specified `result` the enumerator matching the
100 /// specified `string`. Return 0 on success, and a non-zero value with
101 /// no effect on `result` otherwise (i.e., `string` does not match any
102 /// enumerator).
103 static int fromString(Value *result,
104 const bsl::string& string);
105
106 /// Load into the specified `result` the enumerator matching the
107 /// specified `number`. Return 0 on success, and a non-zero value with
108 /// no effect on `result` otherwise (i.e., `number` does not match any
109 /// enumerator).
110 static int fromInt(Value *result, int number);
111
112 /// Write to the specified `stream` the string representation of
113 /// the specified enumeration `value`. Return a reference to
114 /// the modifiable `stream`.
115 static bsl::ostream& print(bsl::ostream& stream, Value value);
116};
117
118// FREE OPERATORS
119
120/// Format the specified `rhs` to the specified output `stream` and
121/// return a reference to the modifiable `stream`.
122inline
123bsl::ostream& operator<<(bsl::ostream& stream, MyEnumeration::Value rhs);
124
125} // close package namespace
126
127// TRAITS
128
130
131
132// ============================================================================
133// INLINE FUNCTION DEFINITIONS
134// ============================================================================
135
136namespace s_baltst {
137
138 // -------------------
139 // class MyEnumeration
140 // -------------------
141
142// CLASS METHODS
143inline
144int MyEnumeration::fromString(Value *result, const bsl::string& string)
145{
146 return fromString(result, string.c_str(), static_cast<int>(string.length()));
147}
148
149inline
150bsl::ostream& MyEnumeration::print(bsl::ostream& stream,
152{
153 return stream << toString(value);
154}
155
156} // close package namespace
157
158// FREE FUNCTIONS
159
160inline
161bsl::ostream& s_baltst::operator<<(
162 bsl::ostream& stream,
164{
165 return s_baltst::MyEnumeration::print(stream, rhs);
166}
167
168
169#endif
170
171// GENERATED BY @BLP_BAS_CODEGEN_VERSION@
172// USING bas_codegen.pl s_baltst_myenumeration.xsd --mode msg --includedir . --msgComponent myenumeration --noRecurse --noExternalization --noHashSupport --noAggregateConversion
173// ----------------------------------------------------------------------------
174// NOTICE:
175// Copyright 2022 Bloomberg Finance L.P. All rights reserved.
176// Property of Bloomberg Finance L.P. (BFLP)
177// This software is made available solely pursuant to the
178// terms of a BFLP license agreement which governs its use.
179// ------------------------------- END-OF-FILE --------------------------------
180
181/** @} */
182/** @} */
183/** @} */
Definition bslstl_string.h:1281
#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 s_baltst_address.h:66
bsl::ostream & operator<<(bsl::ostream &stream, const Address &rhs)
Definition bdlat_enumeratorinfo.h:97
Definition s_baltst_myenumeration.h:67
static int fromInt(Value *result, int number)
static bsl::ostream & print(bsl::ostream &stream, Value value)
Definition s_baltst_myenumeration.h:150
static const char CLASS_NAME[]
Definition s_baltst_myenumeration.h:81
static int fromString(Value *result, const char *string, int stringLength)
Value
Definition s_baltst_myenumeration.h:71
@ VALUE1
Definition s_baltst_myenumeration.h:72
@ VALUE2
Definition s_baltst_myenumeration.h:73
static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]
Definition s_baltst_myenumeration.h:83
@ NUM_ENUMERATORS
Definition s_baltst_myenumeration.h:77
static const char * toString(Value value)