BDE 4.14.0 Production release
|
Provide value-semantic attribute class for decoder options.
This component provides a value-semantic attribute class for specifying options for bdlde::Base64Decoder
.
This class
supports default-generated copy construction and copy assignment, but the constructor is private. To create an object one must call one of the class methods, which will return a newly-constructed object by value. Specialized class methods are provided to create objects configured for the mime
, urlSafe
, and standard
configurations.
Other configurations may be obtained by specifying arguments to the custom
class method, or by calling the setters after the object is created.
This section illustrates intended use of this component.
Suppose we want a Base64DecoderOptions
object configured for MIME encoding, meaning alphabet == e_BASIC
, isPadded == true
, and ignoreMode = e_IGNORE_WHITESPACE
.
First, we call the mime
class method, and we're done.
Then, we check the attributes:
Now, we stream the object:
Finally, we observe the output:
Suppose we want a Base64DecoderOptions
object configured for translating URL's. That would mean alphabet == e_URL
, isPadded == false
, and ignoring neither unrecognized characters nor whitespace.
First, the class method urlSafe
returns an object configured exactly that way, so we simply call it:
Then, we check the attributes:
Now, we stream the object:
Finally, we observe the output:
Suppose we want an options object configured for standard Base64:
First, we can simply call the standard
class method:
Then, we check the attributes:
Now, we stream the object:
Finally, we observe the output:
Suppose we want a really strangely configured options object with alphabet == e_URL
, and padding, and ignoring neither unrecognized characters nor whitespace.
First, we can simply call the custom
class method. The padded
and unrecognizedIsError == true
arguments are last, and they default to true
, so we don't have to pass that.
Then, we check the attributes:
Now, we stream the object:
Finally, we observe the output: