Provide push parser for Base64 types.
More...
Detailed Description
- Outline
-
-
- Purpose:
- Provide push parser for Base64 types.
- Deprecated:
- Use bdlde_base64decoder instead.
-
- Classes:
-
-
- Description:
- The
balxml::Base64Parser
class template provided by this component can be used to parse Base64 characters into one of the supported Base64 types, which are bsl::vector<char>
and bsl::string
. The TYPE
parameter can be one of these two types.
- This class template is a model of the
PushParser
concept, which contains the following methods: int beginParse(TYPE *object);
int endParse();
template <typename INPUT_ITERATOR>
int pushCharacters(INPUT_ITERATOR begin, INPUT_ITERATOR end);
-
- Usage:
- The following snippets of code illustrate the usage of this component. Suppose you had an input stream that contained Base64 data. The following
loadFromBase64Stream
function loads this data into an bsl::vector<char>
blob: The following function demonstrates the loadFromBase64Stream
function: #include <sstream>
void usageExample()
{
const char INPUT[] = "YWJjZA==";
bsl::vector<char> vec;
bsl::istringstream iss(INPUT);
int result = loadFromBase64Stream(&vec, iss);
assert(0 == result);
assert(4 == vec.size());
assert('a' == vec[0]);
assert('b' == vec[1]);
assert('c' == vec[2]);
assert('d' == vec[3]);
}