FBB::Eoi(3bobcat) | End-Of-Information Base class | FBB::Eoi(3bobcat) |
FBB::Eoi - std::streambuf class offering an eoi manipulator
#include <bobcat/eoi>
Linking option: -lbobcat
The class Eoi inherits from std::streambuf and may therefore be used as a base class of classes specializing std::streambuf. It is particularly useful for classes implementing output operations, as it can be used to specify the `true end’ of the generated output. E.g., an std::istream in object may insert its content into a std::ostream out object using the familiar out << in.rdbuf() expression, but that doesn’t allow out to conclude that it has received all of its information. Sometimes additional actions are required to complete the output (this happens with, e.g., EncryptBuf objects (cf. encryptbuf(3bobcat)) where after encrypting all input padding characters may have to be added to the encrypted document). If out is initialized with the address of an EncryptBuf std::streambuf then the true end of the input can be indicated by inserting the eoi manipulator. The resulting expression becomes std::cout << in.rdbuf() << eoi, and the manipulator ensures that the correct padding is handled.
FBB
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace FBB.
std::streambuf
Copy and move constructors (and assignment operators) are not available.
All members of std:streambuf are available, as FBB::Eoi inherits from these classes.
1. define a tt(bool d_eoi) data member, initialized to tt(false);
2. define a tt(void eoi_() override) member;
3. tt(eoi_) returns if tt(d_eoi == true), otherwise:
4. it sets tt(d_eoi) to tt(true) and performs the actions normally
performed by the class’s destructor;
5. the class’s destructor calls tt(eoi_()).
See the example provided in the osymcryptstream(3bobcat) man-page
bobcat/eoi - defines the class interface
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 |