FBB::MmapBuf(3bobcat) | std::streambuf using mmap(2) | FBB::MmapBuf(3bobcat) |
FBB::MmapBuf - a std::streambuf using mmap(2) for file I/O
#include <bobcat/mmapbuf>
Linking option: -lbobcat
The mmap(2) functions map files in the virtual address space of the calling process. Using mmap in C++ is doable, but complex. The MmapBuf std::streambuf class embeds the features of mmap(2), allowing the use of C++’s streams instead of using the raw mmap calls. the FBB::Mmapbase class defines a std::streambuf which can be used by istream, ostream, and iostream objects.
An std::exception is thrown, and an error message is written to cerr if the details about the specified filename (cf. section CONSTRUCORS cannot be determined, or when mmap or munmap return errors.
FBB
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace FBB.
std::streambuf
The mode parameter specifies the user/group/other access mode which is used when the file is created by MmapBuf. Its default value specifies read/write access by the user, and read access by others. )
The move constructor and move assignment operator are available.
The copy constructor and copy assignment operator are not available.
All members of std::stringstream are available, as FBB::MmapBuf inherits from that class.
An example is provided in bobcat’s source archive and gitlab repository at bobcat/mmapbuf/demo.
bobcat/mmapbuf - defines the class interface
bobcat(7), chmod(2), immapstream(3bobcat), iommapstream(3bobcat), ommapstream(3bobcat), mmap(2), sysconf(3)
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-2024 | libbobcat-dev_6.06.02 |