.TH "FBB::TempStream" "3bobcat" "2005\-2023" "libbobcat\-dev_6\&.04\&.00" "Temporary fstream" .PP .SH "NAME" FBB::TempStream \- Temporary fstream .PP .SH "SYNOPSIS" \fB#include \fP .br .PP .SH "DESCRIPTION" \fBFBB::TempStream\fP objects are temporary \fIstd::fstreams\fP opened with mode 0600 (user only read+write)\&. The file created by a \fITempStream\fP object is removed from the file system once the \fITempStream\fP object goes out of scope\&. .PP A \fITempStream\fP object creates an empty file, and information can immediately be inserted into the \fITempStream\fP object\&. To switch between insertion and extraction simply call \fIseekg\fP (for extraction) or \fIseekp\fP (for insertion)\&. .PP .SH "NAMESPACE" \fBFBB\fP .br All constructors, members, operators and manipulators, mentioned in this man\-page, are defined in the namespace \fBFBB\fP\&. .PP .SH "INHERITS FROM" \fBstd::fstream\fP .PP .SH "CONSTRUCTORS" .IP o \fBTempStream(std::string const &base = \(dq\&/tmp/FBB::TempStream\(dq\&)\fP: .br The constructor initializes the object and creates a file with the given base\-name to which six random characters are appended\&. If the \fITempStream\fP could not be constructed an \fIFBB::Exception\fP is thrown\&. .PP Copy and move constructors (and assignment operators) are not available\&. .PP .SH "MEMBER FUNCTIONS" All \fBstd::fstream\fP members are available, as \fBFBB::TempStream\fP inherits from this class\&. In addition, \fITempStream\fP itself offers .IP o \fBstd::string const &fileName() const\fP: .br The name of the created temporary file\&. .PP .SH "EXAMPLE" .nf #include #include using namespace std; using namespace FBB; int main() { TempStream ts(\(dq\&/tmp/demo\(dq\&); ts << \(dq\&Hello world\en\(dq\&; ts\&.seekg(0); string line; getline(ts, line); cout << line << \(dq\&, removed: \(dq\& << ts\&.fileName() << \(cq\&\en\(cq\&; } .fi .PP .SH "FILES" \fIbobcat/tempstream\fP \- defines the class interface .PP .SH "SEE ALSO" \fBbobcat\fP(7), \fBmkostemp\fP(3) .PP .SH "BUGS" None reported\&. .PP .SH "BOBCAT PROJECT FILES" .PP .IP o \fIhttps://fbb\-git\&.gitlab\&.io/bobcat/\fP: gitlab project page; .IP o \fIbobcat_6\&.04\&.00\-x\&.dsc\fP: detached signature; .IP o \fIbobcat_6\&.04\&.00\-x\&.tar\&.gz\fP: source archive; .IP o \fIbobcat_6\&.04\&.00\-x_i386\&.changes\fP: change log; .IP o \fIlibbobcat1_6\&.04\&.00\-x_*\&.deb\fP: debian package containing the libraries; .IP o \fIlibbobcat1\-dev_6\&.04\&.00\-x_*\&.deb\fP: debian package containing the libraries, headers and manual pages; .PP .SH "BOBCAT" Bobcat is an acronym of `Brokken\(cq\&s Own Base Classes And Templates\(cq\&\&. .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP