FBB::IQuotedPrintableBuf(3bobcat) | QuotedPrintable converting Stream Buffer | FBB::IQuotedPrintableBuf(3bobcat) |
FBB::IQuotedPrintableBuf - Input Filtering stream buffer doing quoted printable conversions
#include <bobcat/iquotedprintablebuf>
Linking option: -lbobcat
The information made available by IQuotedPrintableBuf objects is either quoted-printable encoded or decoded. The information to convert is read by IQuotedPrintableBuf objects via std::istream objects.
The class IQuotedPrintableBuf is a class template, using a FBB::CryptType template non-type parameter. Objects of the class FBB::IQuotedPrintableBuf<FBB::ENCODE> encode the information they receive, objects of the class FBB::IQuotedPrintableBuf<FBB::DECODE> decode the information they receive. See also section ENUMERATION below.
Quoted-printable encoding is sometimes used in e-mail attachments (See also https://en.wikipedia.org/wiki/Quoted-printable and https://www.ietf.org/rfc/rfc2045.txt (section 6.7)). Its main characteristics are:
FBB
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace FBB.
FBB::IFilterBuf
All members of FBB::IFilterBuf are available, as IQuotedPrintableBuf inherits from this class.
Overloaded move and/or copy assignment operators are not available.
IQuotedPrintableBuf objects either encode or decode quoted-printable information. IQuotedPrintableBuf objects of the class FBB::IQuotedPrintableBuf<FBB::ENCODE> encode the data they receive, IQuotedPrintableBuf objects of the class FBB::IQuotedPrintableBuf<FBB::DECODE> decode the data they receive.
The values ENCODE and DECODE are defined in the enum CryptType, defined in the FBB namespace.
Copy and move constructors (and assignment operators) are not available.
The example shows the construction of IQuotedPrintableBuf<ENCODE> objects encode which are used to initialize a std::istream object. The information read from this istream is quoted-printable encoded.
IQuotedPrintableBuf<DECODE> objects read quoted-printable encoded information from std::istream objects, decoding the information.
The std::istream din object is initialized with the IQuotedPrintableBuf<DECODE> object, and its content is sent to std::cout. The information that is presented at std::cin and that appears at std::cout should be identical.
#include <iostream> #include <istream> #include <bobcat/iquotedprintablebuf> using namespace std; using namespace FBB; int main(int argc, char **argv) {
if (argc == 1)
{
cout << "Usage: " << argv[0] << " [edb] < infile > outfile\n"
"to quoted printable -e-ncode, -d-ecode or -b-oth\n";
return 0;
}
switch (argv[1][0])
{
case ’e’:
{
IQuotedPrintableBuf<ENCODE> encode(cin);
istream ein(&encode);
cout << ein.rdbuf();
}
break;
case ’d’:
{
IQuotedPrintableBuf<DECODE> decode(cin);
istream din(&decode);
cout << din.rdbuf();
}
break;
case ’b’:
{
IQuotedPrintableBuf<ENCODE> encode(cin);
istream ein(&encode);
IQuotedPrintableBuf<DECODE> decode(ein);
istream din(&decode);
cout << din.rdbuf();
}
break;
} }
bobcat/iquotedprintablebuf - defines the class interface
bobcat(7), isymcryptstreambuf(3bobcat), iquotedprintablestream(3bobcat), ifilterbuf(3bobcat), ofilterbuf(3bobcat), std::streambuf.
None reported.
Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.
This is free software, distributed under the terms of the GNU General Public License (GPL).
Frank B. Brokken (f.b.brokken@rug.nl).
2005-2022 | libbobcat-dev_6.02.02 |