C++ Portable Types Library (PTypes) Version 1.7

Top: Streams: infile

#include <pstreams.h>

infile::infile( [ const string& filename ] );
void infile::pipe(outfile& peer);
string infile::get/set_filename();

This class derives all public methods and properties from iobase and instm, and in addition, defines the following:

infile::infile( [ const string& filename ] ) creates an input file stream, but does not open the file. Filename is optional and can be set later, using set_filename().

void infile::pipe(outfile& peer) creates a local pipe. This function sets up and opens the infile and outfile objects so that a thread can asynchronously pass data to another thread within one process. Note that pipe() opens both streams; subsequent calls to open(), close() or cancel() shuts down the pipe. Local pipe is a slower alternative to the message queue. The only advantage of local pipes is that they provide a standard streaming interface.

string infile::get/set_filename() sets the filename. set_filename() closes the stream prior to assigning the new value.

See also: iobase, instm, Examples

PTypes home