Quick Links:

bal | bbl | bdl | bsl

Namespaces

Component bdlde_charconvertstatus
[Package bdlde]

Provide masks for interpreting status from charconvert functions. More...

Namespaces

namespace  bdlde

Detailed Description

Outline
Purpose:
Provide masks for interpreting status from charconvert functions.
Classes:
bdlde::CharConvertStatus namespace for bit-wise mask of charconvert status
See also:
Component bdlde_charconvertutf16, Component bdlde_charconvertucs2
Description:
This component provides a namespace for the enum type bdlde::CharConvertStatus::Enum, which enumerates the set of bit-wise masks that can be used to interpret return values from translation functions in components bdlde_charconvertutf16 and bdlde_charconvertucs2.
Enumerators:
  Name                      Description
  -------------------   ---------------------------------------------
  k_INVALID_INPUT_BIT   Invalid code points or sequences of bytes / words
                        were encountered in the input.
  k_OUT_OF_SPACE_BIT    The space provided for the output was
                        insufficient for the translation.
Usage:
In this section we show intended usage of this component.
Example 1: Basic Syntax:
The following snippets of code provide a simple illustration of bdlde::CharConvertStatus usage.
First, we create a variable value of type bdlde::CharConvertStatus::Enum and initialize it with the value 3, which is not a valid value of the enum.
      bdlde::CharConvertStatus::Enum value =
                               bdlde::CharConvertStatus::k_INVALID_INPUT_BIT;
Next, we store a pointer to its ASCII representation in a variable asciiValue of type const char *:
      const char *asciiValue = bdlde::CharConvertStatus::toAscii(value);
      assert(0 == bsl::strcmp(asciiValue, "INVALID_INPUT_BIT"));
Finally, we print value to bsl::cout.
      if (veryVerbose) {
          bsl::cout << value << bsl::endl;
      }
This statement produces the following output on stdout:
 INVALID_INPUT_BIT