BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslfmt_standardformatspecification.h
Go to the documentation of this file.
1/// @file bslfmt_standardformatspecification.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslfmt_standardformatspecification.h -*-C++-*-
8
9#ifndef INCLUDED_BSLFMT_STANDARDFORMATSPECIFICATION
10#define INCLUDED_BSLFMT_STANDARDFORMATSPECIFICATION
11
12#include <bsls_ident.h>
13BSLS_IDENT("$Id: $")
14
15/// @defgroup bslfmt_standardformatspecification bslfmt_standardformatspecification
16/// @brief Private utility for use within BSL `format` standard spec parsers
17/// @addtogroup bsl
18/// @{
19/// @addtogroup bslfmt
20/// @{
21/// @addtogroup bslfmt_standardformatspecification
22/// @{
23///
24/// <h1> Outline </h1>
25/// * <a href="#bslfmt_standardformatspecification-purpose"> Purpose</a>
26/// * <a href="#bslfmt_standardformatspecification-classes"> Classes </a>
27/// * <a href="#bslfmt_standardformatspecification-description"> Description </a>
28///
29/// # Purpose {#bslfmt_standardformatspecification-purpose}
30/// Private utility for use within BSL `format` standard spec parsers
31///
32/// # Classes {#bslfmt_standardformatspecification-classes}
33///
34/// - bslfmt::StandardFormatSpecification: utility to parse a format spec
35///
36/// # Description {#bslfmt_standardformatspecification-description}
37/// This component provides a mechanism to parse a formatting
38/// string that is a "standard formatting specification" as defined by
39/// [format.string.std].
40///
41/// This component is for use within `bslfmt` only.
42/// @}
43/** @} */
44/** @} */
45
46/** @addtogroup bsl
47 * @{
48 */
49/** @addtogroup bslfmt
50 * @{
51 */
52/** @addtogroup bslfmt_standardformatspecification
53 * @{
54 */
55
56#include <bslscm_version.h>
57
58#include <bslfmt_formaterror.h>
60
61#include <bslmf_assert.h>
62#include <bslmf_issame.h>
63
64#include <bsls_exceptionutil.h>
65#include <bsls_keyword.h>
66
67
68namespace bslfmt {
69
70 // ==================================
71 // struct StandardFormatSpecification
72 // ==================================
73
74/// A general mechanism to parse and validate a Standard format specification
75/// string for a given argument type.
76template <class t_CHAR>
79
80 public:
81 // TYPES
91
93 // Default value
95
96 // String presentation types
97 e_STRING_DEFAULT, // `s` (default for strings)
99
100 // Integer presentation types
104 e_INTEGRAL_DECIMAL, // `d` (default for integers)
108
109 // Character presentation types
110 e_CHARACTER_CHARACTER, // `c` (default for characters)
112
113 // Boolean presentation type
114 e_BOOLEAN_STRING, // `s` (default for booleans)
115
116 // Floating point types
117 e_FLOATING_DEFAULT, // none (default for floating points)
126
127 // Pointer types
128 e_POINTER_HEX, // `p` for pointers (default for pointers)
129 e_POINTER_HEX_UC, // `P` for pointer
130 };
131
132 private:
133 // PRIVATE TYPES
135
136 // DATA
137 ProcessingState d_processingState; // parsing state
138 Parser d_basicParser; // parsing helper
139 FormatType d_formatType; // requested type
140
141 // PRIVATE MANIPULATORS
142
143 /// Parse, from the specified `typeString`, the requested format-type and
144 /// load it into the `d_formatType` of this object. The
145 /// specified `category` determines the mapping table used from character
146 /// to format-type. This method will throw a `bsl::format_error` exception
147 /// in case the `typeString` is not empty or a valid, single format
148 /// character.
149 BSLS_KEYWORD_CONSTEXPR_CPP20 void parseType(
150 const bsl::basic_string_view<t_CHAR>& typeString,
151 Category category);
152
153 // PRIVATE ACCESSORS
154 /// Return `true`if the integer presentation type is requested, and `false`
155 /// otherwise.
156 BSLS_KEYWORD_CONSTEXPR_CPP20 bool isIntegerPresentationType() const;
157
158 /// Return `true`if the floating-point presentation type is requested, and
159 /// `false` otherwise.
160 BSLS_KEYWORD_CONSTEXPR_CPP20 bool isFloatingPresentationType() const;
161
162 /// Return `true`if the pointer presentation type is requested, and `false`
163 /// otherwise.
164 BSLS_KEYWORD_CONSTEXPR_CPP20 bool isPointerPresentationType() const;
165
166 public:
167 // CREATORS
168
169 /// Create an uninitialized `StandardFormatSpecification` object.
171
172 // MANIPULATORS
173
174 /// Parse a format string using the iterator-range from the specified
175 /// `context` assuming it is a Standard format specification for arguments
176 /// of the specified `category` and if successful update this object with
177 /// the parsing result, as well as set the status to `e_PARSED`; otherwise,
178 /// if the format specification denoted by the `context` iterator-range is
179 /// not a valid Standard format specification for arguments of category
180 /// `category` throw a `bsl::format_error` exception.
181 template <class t_PARSE_CONTEXT>
182 BSLS_KEYWORD_CONSTEXPR_CPP20 void parse(t_PARSE_CONTEXT *context,
183 Category category);
184
185 /// Update the corresponding attributes of this object using the argument
186 /// values provided by the specified `context` to fill in the values of
187 /// nested width or precision parameters if such nested parameters exist
188 /// and set the status of this object to `e_STATE_POSTPROCESSED`. By
189 /// nested format parameters we mean parameters whose value comes from an
190 /// argument to the formatter function, and not an literal integer value
191 /// within the format string. In case of an error throw a
192 /// `bsl::format_error` exception.
193 template <typename t_FORMAT_CONTEXT>
194 void postprocess(const t_FORMAT_CONTEXT& context);
195
196 // ACCESSORS
197
198 /// Return a pointer to the character array that stores the parsed filler
199 /// character that may be a multibyte code point or just a single character
200 /// unless the status is not `e_STATE_PARSED` or `e_STATE_POSTPROCESSED` in
201 /// which case throw a `bsl::format_error` exception indicating that error.
202 /// See also `numFillerCharacters()` that provides the number of characters
203 /// in the array returned by this function (at least one).
204 BSLS_KEYWORD_CONSTEXPR_CPP20 const t_CHAR *filler() const;
205
206 /// Return the number of filler characters in the array returned by
207 /// `filler()` unless the status is not `e_STATE_PARSED` or
208 /// `e_STATE_POSTPROCESSED` in which case throw a `bsl::format_error`
209 /// exception indicating that error.
211
212 /// Return the display width of the code point represented by the array
213 /// returned by `filler()` unless the status is not `e_STATE_PARSED` or
214 /// `e_STATE_POSTPROCESSED` in which case throw a `bsl::format_error`
215 /// exception indicating that error.
217
218 /// Return the enumerator representing the requested alignment unless the
219 /// status is not at least `e_STATE_PARSED` in which case throw a
220 /// `bsl::format_error` exception indicating that error.
222
223 /// Return the enumerator representing the requested sign-treatment option
224 /// unless the status is not at least `e_STATE_PARSED` in which case throw
225 /// a `bsl::format_error` exception indicating that error.
227
228 /// Return a boolean indicating if alternative formatting was requested
229 /// unless the status is not at least `e_STATE_PARSED` in which case
230 /// throw a `bsl::format_error` exception indicating that error.
232
233 /// Return a boolean indicating if zero padding was requested unless the
234 /// status is not at least `e_STATE_PARSED` in which case throw a
235 /// `bsl::format_error` exception indicating that error.
237
238 /// Return an optional value representing the requested width unless the
239 /// status is not `e_STATE_POSTPROCESSED` in which case throw a `bsl::format_error` exception indicating that error.
240 ///
241 /// \note Note that the
242 /// returned type is capable of representing more than just an optional
243 /// integer, but after preprocessing it will have only two possible states:
244 /// no value, or an integer value.
246 postprocessedWidth() const;
247
248 /// Return an optional value representing the requested precision unless
249 /// the status is not `e_STATE_POSTPROCESSED` in which case throw a `bsl::format_error` exception indicating that error.
250 ///
251 /// \note Note that the
252 /// returned type is capable of representing more than just an optional
253 /// integer, but after preprocessing it will have only two possible states:
254 /// no value, or an integer value.
257
258 /// Return a boolean indicating if the locale specific flag was present in
259 /// the format specification unless the status is not at least
260 /// `e_STATE_PARSED` in which case throw a `bsl::format_error` exception indicating that error.
261 ///
262 /// \note Note that the locale specific flag is not yet
263 /// supported hence the attempt to format with a specification that has
264 /// this flags set will result in an exception indicating that.
266
267 /// Return the enumerator representing the requested format type unless the
268 /// status is not at least `e_STATE_PARSED` in which case throw a
269 /// `bsl::format_error` exception indicating that error.
271
272 /// Return the current processing state of this specification.
275};
276
277// ============================================================================
278// INLINE DEFINITIONS
279// ============================================================================
280
281 // ---------------------------------
282 // class StandardFormatSpecification
283 // ---------------------------------
284
285// PRIVATE CLASS METHODS
286
287template <class t_CHAR>
289void StandardFormatSpecification<t_CHAR>::parseType(
290 const bsl::basic_string_view<t_CHAR>& typeString,
291 Category category)
292{
293 // Handle empty string or empty specification.
294 if (typeString.empty()) {
295 switch (category) {
296 case e_CATEGORY_UNASSIGNED: {
297 d_formatType = e_TYPE_UNASSIGNED;
298 BSLS_THROW(bsl::format_error("Unassigned category")); // THROW
299 } break;
300 case e_CATEGORY_STRING: {
301 d_formatType = e_STRING_DEFAULT;
302 } break;
303 case e_CATEGORY_INTEGRAL: {
304 d_formatType = e_INTEGRAL_DECIMAL;
305 } break;
306 case e_CATEGORY_CHARACTER: {
307 d_formatType = e_CHARACTER_CHARACTER;
308 } break;
309 case e_CATEGORY_BOOLEAN: {
310 d_formatType = e_BOOLEAN_STRING;
311 } break;
312 case e_CATEGORY_FLOATING: {
313 d_formatType = e_FLOATING_DEFAULT;
314 } break;
315 case e_CATEGORY_POINTER: {
316 d_formatType = e_POINTER_HEX;
317 } break;
318 default: {
319 d_formatType = e_TYPE_UNASSIGNED;
320 BSLS_THROW(bsl::format_error("Unexpected category")); // THROW
321 }
322 }
323 return; // RETURN
324 }
325
326 // Standard format strings only allow a single type character.
327 if (typeString.size() > 1) {
328 d_formatType = e_TYPE_UNASSIGNED;
330 bsl::format_error("Standard types are single-character")); // THROW
331 }
332
333 t_CHAR frontChar = typeString.front();
334
335 // The type character can only be ascii so we can do a simple cast.
336 char typeChar = (frontChar >= 0 && frontChar <= 0x7f)
337 ? static_cast<char>(frontChar)
338 : static_cast<char>(0);
339
340 switch (category) {
341 case e_CATEGORY_UNASSIGNED: {
342 d_formatType = e_TYPE_UNASSIGNED;
343 BSLS_THROW(bsl::format_error("Invalid unassigned category")); // THROW
344 } break;
345 case e_CATEGORY_STRING: {
346 switch (typeChar) {
347 case 's': {
348 d_formatType = e_STRING_DEFAULT;
349 } break;
350 case '?': {
351 d_formatType = e_STRING_ESCAPED;
352 } break;
353 default: {
354 d_formatType = e_TYPE_UNASSIGNED;
356 bsl::format_error("Invalid type for string")); // THROW
357 }
358 }
359 } break;
360 case e_CATEGORY_INTEGRAL: {
361 switch (typeChar) {
362 case 'b': {
363 d_formatType = e_INTEGRAL_BINARY;
364 } break;
365 case 'B': {
366 d_formatType = e_INTEGRAL_BINARY_UC;
367 } break;
368 case 'c': {
369 d_formatType = e_INTEGRAL_CHARACTER;
370 } break;
371 case 'd': {
372 d_formatType = e_INTEGRAL_DECIMAL;
373 } break;
374 case 'o': {
375 d_formatType = e_INTEGRAL_OCTAL;
376 } break;
377 case 'x': {
378 d_formatType = e_INTEGRAL_HEX;
379 } break;
380 case 'X': {
381 d_formatType = e_INTEGRAL_HEX_UC;
382 } break;
383 default: {
384 d_formatType = e_TYPE_UNASSIGNED;
386 bsl::format_error("Invalid type for integers")); // THROW
387 }
388 }
389 } break;
390 case e_CATEGORY_CHARACTER: {
391 switch (typeChar) {
392 case 'b': {
393 d_formatType = e_INTEGRAL_BINARY;
394 } break;
395 case 'B': {
396 d_formatType = e_INTEGRAL_BINARY_UC;
397 } break;
398 case 'c': {
399 d_formatType = e_CHARACTER_CHARACTER;
400 } break;
401 case 'd': {
402 d_formatType = e_INTEGRAL_DECIMAL;
403 } break;
404 case 'o': {
405 d_formatType = e_INTEGRAL_OCTAL;
406 } break;
407 case 'x': {
408 d_formatType = e_INTEGRAL_HEX;
409 } break;
410 case 'X': {
411 d_formatType = e_INTEGRAL_HEX_UC;
412 } break;
413 case '?': {
414 d_formatType = e_CHARACTER_ESCAPED;
415 } break;
416 default: {
417 d_formatType = e_TYPE_UNASSIGNED;
419 bsl::format_error("Invalid type for character types")); // THROW
420 }
421 }
422 } break;
423 case e_CATEGORY_BOOLEAN: {
424 switch (typeChar) {
425 case 'b': {
426 d_formatType = e_INTEGRAL_BINARY;
427 } break;
428 case 'B': {
429 d_formatType = e_INTEGRAL_BINARY_UC;
430 } break;
431 case 'd': {
432 d_formatType = e_INTEGRAL_DECIMAL;
433 } break;
434 case 'o': {
435 d_formatType = e_INTEGRAL_OCTAL;
436 } break;
437 case 's': {
438 d_formatType = e_BOOLEAN_STRING;
439 } break;
440 case 'x': {
441 d_formatType = e_INTEGRAL_HEX;
442 } break;
443 case 'X': {
444 d_formatType = e_INTEGRAL_HEX_UC;
445 } break;
446 default: {
447 d_formatType = e_TYPE_UNASSIGNED;
449 bsl::format_error("Invalid type for booleans")); // THROW
450 }
451 }
452 } break;
453 case e_CATEGORY_FLOATING: {
454 switch (typeChar) {
455 case 'a': {
456 d_formatType = e_FLOATING_HEX;
457 } break;
458 case 'A': {
459 d_formatType = e_FLOATING_HEX_UC;
460 } break;
461 case 'e': {
462 d_formatType = e_FLOATING_SCIENTIFIC;
463 } break;
464 case 'E': {
465 d_formatType = e_FLOATING_SCIENTIFIC_UC;
466 } break;
467 case 'f': {
468 d_formatType = e_FLOATING_FIXED;
469 } break;
470 case 'F': {
471 d_formatType = e_FLOATING_FIXED_UC;
472 } break;
473 case 'g': {
474 d_formatType = e_FLOATING_GENERAL;
475 } break;
476 case 'G': {
477 d_formatType = e_FLOATING_GENERAL_UC;
478 } break;
479 default: {
480 d_formatType = e_TYPE_UNASSIGNED;
482 bsl::format_error("Invalid type for floating points")); // THROW
483 }
484 }
485 } break;
486 case e_CATEGORY_POINTER: {
487 switch (typeChar) {
488 case 'p': {
489 d_formatType = e_POINTER_HEX;
490 } break;
491 case 'P': {
492 d_formatType = e_POINTER_HEX_UC;
493 } break;
494 default: {
495 d_formatType = e_TYPE_UNASSIGNED;
497 bsl::format_error("Invalid type for pointers")); // THROW
498 }
499 }
500 } break;
501 default: {
502 d_formatType = e_TYPE_UNASSIGNED;
504 bsl::format_error("Invalid type for default category")); // THROW
505 }
506 }
507
508 if (e_TYPE_UNASSIGNED == d_formatType) {
510 bsl::format_error("Failed to parse type (reason unknown)")); // THROW
511 }
512}
513
514 // PRIVATE ACCESSORS
515
516template <class t_CHAR>
518bool StandardFormatSpecification<t_CHAR>::isIntegerPresentationType() const
519{
520 return e_INTEGRAL_BINARY == formatType() || // `b`
521 e_INTEGRAL_BINARY_UC == formatType() || // `B`
522 e_INTEGRAL_CHARACTER == formatType() || // `c`
523 e_INTEGRAL_DECIMAL == formatType() || // `d` (default)
524 e_INTEGRAL_OCTAL == formatType() || // `o`
525 e_INTEGRAL_HEX == formatType() || // `x`
526 e_INTEGRAL_HEX_UC == formatType(); // `X`
527}
528
529template <class t_CHAR>
531bool StandardFormatSpecification<t_CHAR>::isFloatingPresentationType() const
532{
533 return e_FLOATING_DEFAULT == formatType() || // none (default)
534 e_FLOATING_HEX == formatType() || // `a`
535 e_FLOATING_HEX_UC == formatType() || // `A`
536 e_FLOATING_SCIENTIFIC == formatType() || // `e`
537 e_FLOATING_SCIENTIFIC_UC == formatType() || // `E`
538 e_FLOATING_FIXED == formatType() || // `f`
539 e_FLOATING_FIXED_UC == formatType() || // `F`
540 e_FLOATING_GENERAL == formatType() || // `g`
541 e_FLOATING_GENERAL_UC == formatType(); // `G`
542}
543
544template <class t_CHAR>
546bool StandardFormatSpecification<t_CHAR>::isPointerPresentationType() const
547{
548 return e_POINTER_HEX == formatType() || // `p`
549 e_POINTER_HEX_UC == formatType(); // `P`
550}
551
552// CLASS METHODS
553
554template <class t_CHAR>
555template <class t_PARSE_CONTEXT>
557 t_PARSE_CONTEXT *context,
558 Category category)
559{
561 bsl::is_same<typename bsl::iterator_traits<
562 typename t_PARSE_CONTEXT::const_iterator>::value_type,
563 t_CHAR>::value));
564
565 typedef FormatterSpecificationNumericValue NumericValue;
566
567 d_processingState = e_STATE_PARSED;
568
569 const Sections sect = static_cast<Sections>(
570 e_SECTIONS_FILL_ALIGN |
571 e_SECTIONS_SIGN_FLAG |
572 e_SECTIONS_ALTERNATE_FLAG |
573 e_SECTIONS_ZERO_PAD_FLAG |
574 e_SECTIONS_WIDTH |
575 e_SECTIONS_PRECISION |
576 e_SECTIONS_LOCALE_FLAG |
577 e_SECTIONS_REMAINING_SPEC);
578
579 d_basicParser.parse(context, sect);
580
581 if (NumericValue::e_DEFAULT != d_basicParser.rawPrecision().category() &&
582 e_CATEGORY_STRING != category && e_CATEGORY_FLOATING != category) {
583 BSLS_THROW(bsl::format_error("Standard specification parse failure "
584 "(precision is used with inappropriate "
585 "type)")); // THROW
586 }
587
588 parseType(d_basicParser.remainingSpec(), category);
589
590 if (e_SIGN_DEFAULT != sign() || alternativeFlag()) {
591 if (!isIntegerPresentationType() && !isFloatingPresentationType()) {
592 BSLS_THROW(bsl::format_error("Hash / sign option requires an "
593 "arithmetic presentation type")); // THROW
594 }
595 }
596
597 if (zeroPaddingFlag()) {
598 if (!isIntegerPresentationType() && !isFloatingPresentationType() &&
599 !isPointerPresentationType()) {
600 BSLS_THROW(bsl::format_error("Zero option requires an "
601 "arithmetic presentation type")); // THROW
602 }
603 }
604
605 if (context->begin() == context->end() || *context->begin() == '}') {
606 return; // RETURN
607 }
608
609 BSLS_THROW(bsl::format_error("Standard specification parse failure "
610 "(invalid character)")); // THROW
611}
612
613template <class t_CHAR>
614template <typename t_FORMAT_CONTEXT>
616 const t_FORMAT_CONTEXT& context)
617{
618 if (d_processingState == e_STATE_UNPARSED)
619 BSLS_THROW(bsl::format_error(
620 "Format standard specification '.parse' not called")); // THROW
621
622 d_basicParser.postprocess(context);
623
624 switch (d_basicParser.postprocessedWidth().category()) {
626 } break;
628 if (d_basicParser.postprocessedWidth().value() <= 0)
630 bsl::format_error("Zero or negative width value")); // THROW
631 } break;
632 default: {
634 bsl::format_error("Failed to find valid width value")); // THROW
635 }
636 }
637
638 switch (d_basicParser.postprocessedPrecision().category()) {
640 } break;
642 if (d_basicParser.postprocessedPrecision().value() < 0)
644 bsl::format_error("Negative precision value")); // THROW
645 } break;
646 default: {
648 bsl::format_error("Failed to find valid precision value")); // THROW
649 }
650 }
651
652 d_processingState = e_STATE_POSTPROCESSED;
653}
654
655// CREATORS
656template <class t_CHAR>
659: d_processingState(StandardFormatSpecification::e_STATE_UNPARSED)
660, d_basicParser()
661, d_formatType(StandardFormatSpecification::e_TYPE_UNASSIGNED)
662{
663}
664
665// ACCESSORS
666template <class t_CHAR>
669{
670 return d_basicParser.filler();
671}
672
673template <class t_CHAR>
676{
677 return d_basicParser.numFillerCharacters();
678}
679
680template <class t_CHAR>
683{
684 return d_basicParser.fillerCodePointDisplayWidth();
685}
686
687template <class t_CHAR>
689typename
692{
693 return d_basicParser.alignment();
694}
695
696template <class t_CHAR>
698typename
701{
702 return d_basicParser.sign();
703}
704
705template <class t_CHAR>
708{
709 return d_basicParser.alternativeFlag();
710}
711
712template <class t_CHAR>
715{
716 return d_basicParser.zeroPaddingFlag();
717}
718
719template <class t_CHAR>
723{
724 return d_basicParser.postprocessedWidth();
725}
726
727template <class t_CHAR>
731{
732 return d_basicParser.postprocessedPrecision();
733}
734
735template <class t_CHAR>
738{
739 return d_basicParser.localeSpecificFlag();
740}
741
742template <class t_CHAR>
746{
747 if (e_STATE_UNPARSED == d_processingState)
748 BSLS_THROW(bsl::format_error(
749 "Format standard specification '.parse' not called")); // THROW
750
751 return d_formatType;
752}
753
754template <class t_CHAR>
758{
759 return d_processingState;
760}
761
762} // close package namespace
763
764
765#endif // INCLUDED_BSLFMT_STANDARDFORMATSPECIFICATION
766
767// ----------------------------------------------------------------------------
768// Copyright 2025 Bloomberg Finance L.P.
769//
770// Licensed under the Apache License, Version 2.0 (the "License");
771// you may not use this file except in compliance with the License.
772// You may obtain a copy of the License at
773//
774// http://www.apache.org/licenses/LICENSE-2.0
775//
776// Unless required by applicable law or agreed to in writing, software
777// distributed under the License is distributed on an "AS IS" BASIS,
778// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
779// See the License for the specific language governing permissions and
780// limitations under the License.
781// ----------------------------- END-OF-FILE ----------------------------------
782
783/** @} */
784/** @} */
785/** @} */
Definition bslstl_stringview.h:471
BSLS_KEYWORD_CONSTEXPR size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the length of this view.
Definition bslstl_stringview.h:1904
BSLS_KEYWORD_CONSTEXPR_CPP14 const_reference front() const
Definition bslstl_stringview.h:1966
BSLS_KEYWORD_CONSTEXPR bool empty() const BSLS_KEYWORD_NOEXCEPT
Return true if this view has length 0, and false otherwise.
Definition bslstl_stringview.h:1931
Definition bslfmt_formatspecificationparser.h:151
Definition bslfmt_standardformatspecification.h:78
BSLS_KEYWORD_CONSTEXPR_CPP20 bool alternativeFlag() const
Definition bslfmt_standardformatspecification.h:707
void postprocess(const t_FORMAT_CONTEXT &context)
Definition bslfmt_standardformatspecification.h:615
BSLS_KEYWORD_CONSTEXPR_CPP20 int numFillerCharacters() const
Definition bslfmt_standardformatspecification.h:675
BSLS_KEYWORD_CONSTEXPR_CPP20 FormatSpecificationParserEnums::ProcessingState processingState() const
Return the current processing state of this specification.
Definition bslfmt_standardformatspecification.h:757
BSLS_KEYWORD_CONSTEXPR_CPP20 const FormatterSpecificationNumericValue postprocessedPrecision() const
Definition bslfmt_standardformatspecification.h:730
BSLS_KEYWORD_CONSTEXPR_CPP20 Sign sign() const
Definition bslfmt_standardformatspecification.h:700
BSLS_KEYWORD_CONSTEXPR_CPP20 const FormatterSpecificationNumericValue postprocessedWidth() const
Definition bslfmt_standardformatspecification.h:722
BSLS_KEYWORD_CONSTEXPR_CPP20 bool zeroPaddingFlag() const
Definition bslfmt_standardformatspecification.h:714
FormatType
Definition bslfmt_standardformatspecification.h:92
@ e_FLOATING_DEFAULT
Definition bslfmt_standardformatspecification.h:117
@ e_POINTER_HEX_UC
Definition bslfmt_standardformatspecification.h:129
@ e_FLOATING_GENERAL_UC
Definition bslfmt_standardformatspecification.h:125
@ e_TYPE_UNASSIGNED
Definition bslfmt_standardformatspecification.h:94
@ e_FLOATING_SCIENTIFIC
Definition bslfmt_standardformatspecification.h:120
@ e_INTEGRAL_HEX_UC
Definition bslfmt_standardformatspecification.h:107
@ e_BOOLEAN_STRING
Definition bslfmt_standardformatspecification.h:114
@ e_FLOATING_HEX_UC
Definition bslfmt_standardformatspecification.h:119
@ e_INTEGRAL_CHARACTER
Definition bslfmt_standardformatspecification.h:103
@ e_INTEGRAL_HEX
Definition bslfmt_standardformatspecification.h:106
@ e_STRING_ESCAPED
Definition bslfmt_standardformatspecification.h:98
@ e_INTEGRAL_BINARY
Definition bslfmt_standardformatspecification.h:101
@ e_INTEGRAL_OCTAL
Definition bslfmt_standardformatspecification.h:105
@ e_INTEGRAL_BINARY_UC
Definition bslfmt_standardformatspecification.h:102
@ e_POINTER_HEX
Definition bslfmt_standardformatspecification.h:128
@ e_FLOATING_HEX
Definition bslfmt_standardformatspecification.h:118
@ e_CHARACTER_CHARACTER
Definition bslfmt_standardformatspecification.h:110
@ e_FLOATING_FIXED
Definition bslfmt_standardformatspecification.h:122
@ e_CHARACTER_ESCAPED
Definition bslfmt_standardformatspecification.h:111
@ e_FLOATING_SCIENTIFIC_UC
Definition bslfmt_standardformatspecification.h:121
@ e_INTEGRAL_DECIMAL
Definition bslfmt_standardformatspecification.h:104
@ e_STRING_DEFAULT
Definition bslfmt_standardformatspecification.h:97
@ e_FLOATING_FIXED_UC
Definition bslfmt_standardformatspecification.h:123
@ e_FLOATING_GENERAL
Definition bslfmt_standardformatspecification.h:124
BSLS_KEYWORD_CONSTEXPR_CPP20 FormatType formatType() const
Definition bslfmt_standardformatspecification.h:745
BSLS_KEYWORD_CONSTEXPR_CPP20 int fillerCodePointDisplayWidth() const
Definition bslfmt_standardformatspecification.h:682
BSLS_KEYWORD_CONSTEXPR_CPP20 StandardFormatSpecification()
Create an uninitialized StandardFormatSpecification object.
Definition bslfmt_standardformatspecification.h:658
Category
Definition bslfmt_standardformatspecification.h:82
@ e_CATEGORY_POINTER
Definition bslfmt_standardformatspecification.h:89
@ e_CATEGORY_FLOATING
Definition bslfmt_standardformatspecification.h:88
@ e_CATEGORY_STRING
Definition bslfmt_standardformatspecification.h:84
@ e_CATEGORY_UNASSIGNED
Definition bslfmt_standardformatspecification.h:83
@ e_CATEGORY_INTEGRAL
Definition bslfmt_standardformatspecification.h:85
@ e_CATEGORY_CHARACTER
Definition bslfmt_standardformatspecification.h:86
@ e_CATEGORY_BOOLEAN
Definition bslfmt_standardformatspecification.h:87
BSLS_KEYWORD_CONSTEXPR_CPP20 bool localeSpecificFlag() const
Definition bslfmt_standardformatspecification.h:737
BSLS_KEYWORD_CONSTEXPR_CPP20 Alignment alignment() const
Definition bslfmt_standardformatspecification.h:691
BSLS_KEYWORD_CONSTEXPR_CPP20 void parse(t_PARSE_CONTEXT *context, Category category)
Definition bslfmt_standardformatspecification.h:556
BSLS_KEYWORD_CONSTEXPR_CPP20 const t_CHAR * filler() const
Definition bslfmt_standardformatspecification.h:668
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:231
#define BSLS_THROW(X)
Definition bsls_exceptionutil.h:374
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
#define BSLS_KEYWORD_CONSTEXPR_CPP20
Definition bsls_keyword.h:645
Definition bslfmt_enablestreamedformatter.h:130
Definition bslmf_issame.h:146
Definition bslfmt_formatspecificationparser.h:105
Alignment
Definition bslfmt_formatspecificationparser.h:114
Sections
Definition bslfmt_formatspecificationparser.h:128
Sign
Definition bslfmt_formatspecificationparser.h:121
ProcessingState
Definition bslfmt_formatspecificationparser.h:108
Definition bslfmt_formatterspecificationnumericvalue.h:100
@ e_VALUE
Definition bslfmt_formatterspecificationnumericvalue.h:105
@ e_DEFAULT
Definition bslfmt_formatterspecificationnumericvalue.h:104
void BSLS_KEYWORD_CONSTEXPR_CPP20 parse(t_ITER *start, t_ITER end, bool needInitialDot)