BDE 4.39.x Production Release
Loading...
Searching...
No Matches
balber_berconstants.h
Go to the documentation of this file.
1/// @file balber_berconstants.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// balber_berconstants.h -*-C++-*-
8#ifndef INCLUDED_BALBER_BERCONSTANTS
9#define INCLUDED_BALBER_BERCONSTANTS
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup balber_berconstants balber_berconstants
15/// @brief Provide namespace for BER-related constants.
16/// @addtogroup bal
17/// @{
18/// @addtogroup balber
19/// @{
20/// @addtogroup balber_berconstants
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#balber_berconstants-purpose"> Purpose</a>
25/// * <a href="#balber_berconstants-classes"> Classes </a>
26/// * <a href="#balber_berconstants-description"> Description </a>
27/// * <a href="#balber_berconstants-usage"> Usage </a>
28/// * <a href="#balber_berconstants-example-1-basic-usage"> Example 1: Basic Usage </a>
29///
30/// # Purpose {#balber_berconstants-purpose}
31/// Provide namespace for BER-related constants.
32///
33/// # Classes {#balber_berconstants-classes}
34///
35/// - balber::BerConstants: namespace for BER-related constants
36///
37/// @see BER Specification (ITU-T X.690)
38///
39/// # Description {#balber_berconstants-description}
40/// The `balber::BerConstants` `struct` defined in this component
41/// defines two enumerations, `balber::TagClass` and `balber::TagType`, that
42/// contain symbolic constants for the corresponding tag classes and tag types,
43/// as defined in the BER specification (X.690). Also defined are constants
44/// used for encoding and decoding, such as the tag number for the array length
45/// hint.
46///
47/// ## Usage {#balber_berconstants-usage}
48///
49///
50/// This section illustrates intended use of this component.
51///
52/// ### Example 1: Basic Usage {#balber_berconstants-example-1-basic-usage}
53///
54///
55/// TBD
56/// @}
57/** @} */
58/** @} */
59
60/** @addtogroup bal
61 * @{
62 */
63/** @addtogroup balber
64 * @{
65 */
66/** @addtogroup balber_berconstants
67 * @{
68 */
69
70#include <balscm_version.h>
71
72#include <bsl_iosfwd.h>
73
74#ifndef BDE_OMIT_INTERNAL_DEPRECATED
75#undef UNIVERSAL
76#undef APPLICATION
77#undef CONTEXT_SPECIFIC
78#undef PRIVATE
79#undef PRIMITIVE
80#undef CONSTRUCTED
81#endif // BDE_OMIT_INTERNAL_DEPRECATED
82
83
84namespace balber {
85
86 // ===================
87 // struct BerConstants
88 // ===================
89
90/// This `struct` contains enumerations of the constants used by the BER
91/// encoder and decoder.
92///
93/// See @ref balber_berconstants
95
96 enum TagClass {
97 // Enumeration of the four possible BER tag classes.
98
99 e_UNIVERSAL = 0x00 // the universal tag class
100 , e_APPLICATION = 0x40 // the application tag class
101 , e_CONTEXT_SPECIFIC = 0x80 // the context-specific tag class
102 , e_PRIVATE = 0xC0 // the private tag class
103
104#ifndef BDE_OMIT_INTERNAL_DEPRECATED
109
114#endif // BDE_OMIT_INTERNAL_DEPRECATED
115 };
116
117 enum TagType {
118 // Enumeration of the two possible BER tag types.
119
120 e_PRIMITIVE = 0x00 // the primitive tag type
121 , e_CONSTRUCTED = 0x20 // the constructed tag type
122
123#ifndef BDE_OMIT_INTERNAL_DEPRECATED
126
129#endif // BDE_OMIT_INTERNAL_DEPRECATED
130 };
131
132 static const int k_ARRAY_LENGTH_HINT_TAG_NUMBER = 0x7fffffff;
133};
134
135// FREE OPERATORS
136
137/// Format the specified `tagClass` to the specified output `stream` and
138/// return a reference providing modifiable access to `stream`.
139bsl::ostream& operator<<(bsl::ostream& stream,
140 BerConstants::TagClass tagClass);
141
142/// Format the specified `tagType` to the specified output `stream` and
143/// return a reference providing modifiable access to `stream`.
144bsl::ostream& operator<<(bsl::ostream& stream,
145 BerConstants::TagType tagType);
146
147} // close package namespace
148
149#endif
150
151// ----------------------------------------------------------------------------
152// Copyright 2015 Bloomberg Finance L.P.
153//
154// Licensed under the Apache License, Version 2.0 (the "License");
155// you may not use this file except in compliance with the License.
156// You may obtain a copy of the License at
157//
158// http://www.apache.org/licenses/LICENSE-2.0
159//
160// Unless required by applicable law or agreed to in writing, software
161// distributed under the License is distributed on an "AS IS" BASIS,
162// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
163// See the License for the specific language governing permissions and
164// limitations under the License.
165// ----------------------------- END-OF-FILE ----------------------------------
166
167/** @} */
168/** @} */
169/** @} */
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition balber_berconstants.h:84
bsl::ostream & operator<<(bsl::ostream &stream, BerConstants::TagClass tagClass)
Definition balber_berconstants.h:94
TagType
Definition balber_berconstants.h:117
@ PRIMITIVE
Definition balber_berconstants.h:127
@ e_PRIMITIVE
Definition balber_berconstants.h:120
@ e_CONSTRUCTED
Definition balber_berconstants.h:121
@ BDEM_PRIMITIVE
Definition balber_berconstants.h:124
@ CONSTRUCTED
Definition balber_berconstants.h:128
@ BDEM_CONSTRUCTED
Definition balber_berconstants.h:125
TagClass
Definition balber_berconstants.h:96
@ e_CONTEXT_SPECIFIC
Definition balber_berconstants.h:101
@ BDEM_PRIVATE
Definition balber_berconstants.h:108
@ e_UNIVERSAL
Definition balber_berconstants.h:99
@ BDEM_UNIVERSAL
Definition balber_berconstants.h:105
@ BDEM_APPLICATION
Definition balber_berconstants.h:106
@ UNIVERSAL
Definition balber_berconstants.h:110
@ e_PRIVATE
Definition balber_berconstants.h:102
@ e_APPLICATION
Definition balber_berconstants.h:100
@ APPLICATION
Definition balber_berconstants.h:111
@ CONTEXT_SPECIFIC
Definition balber_berconstants.h:112
@ PRIVATE
Definition balber_berconstants.h:113
@ BDEM_CONTEXT_SPECIFIC
Definition balber_berconstants.h:107
static const int k_ARRAY_LENGTH_HINT_TAG_NUMBER
Definition balber_berconstants.h:132