Quick Links:

bal | bbl | bdl | bsl

Namespaces

Component bdlde_base64ignoremode
[Package bdlde]

Provide an enumeration of the set of possible base64 ignore modes. More...

Namespaces

namespace  bdlde

Detailed Description

Outline
Purpose:
Provide an enumeration of the set of possible base64 ignore modes.
Classes:
bdlde::Base64IgnoreMode namespace for an ignore mode enum
See also:
bdlde_base64decorderoptions, Component bdlde_base64decoder
Description:
This component provides a namespace for the enum type bdlde::Base64IgnoreMode::Enum, which enumerates the set of possible ignore modes for the bdlde::Base64Decoder.
Enumerators:
  Name                    Description
  ---------------         ---------------------------------------------------
  e_IGNORE_NONE           Any unrecognized character is an error
  e_IGNORE_WHITESPACE     Any unrecognized character other than whitespace is
                          an error
  e_IGNORE_UNRECOGNIZED   No unrecognized character is an error
Usage:
In this section we show intended use of this component.
Example 1: Basic Syntax:
The following snippets of code provide a simple illustration of bdlde::Base64IgnoreMode usage.
First, we create variable of type bdlde::Base64IgnoreMode::Enum and initialize it with the enumerator values:
  const bdlde::Base64IgnoreMode::Enum none =
                                bdlde::Base64IgnoreMode::e_IGNORE_NONE;
  const bdlde::Base64IgnoreMode::Enum whitespace  =
                                bdlde::Base64IgnoreMode::e_IGNORE_WHITESPACE;
Next, we store a pointer to their ASCII representation in variables of type const char *:
  const char *asciiNone       = bdlde::Base64IgnoreMode::toAscii(none);
  const char *asciiWhitespace = bdlde::Base64IgnoreMode::toAscii(whitespace);
  assert(0 == bsl::strcmp(asciiNone,       "IGNORE_NONE"));
  assert(0 == bsl::strcmp(asciiWhitespace, "IGNORE_WHITESPACE"));
Now, we stream some Enums to ostreams:
  bsl::ostringstream ossNone, ossWhitespace;

  ossNone       << none;
  ossWhitespace << whitespace;
Finally, we observe the output of the streaming:
  assert(ossNone.str()       == "IGNORE_NONE");
  assert(ossWhitespace.str() == "IGNORE_WHITESPACE");

  assert(ossNone.str()       == asciiNone);
  assert(ossWhitespace.str() == asciiWhitespace);