A stream that can include other files. More...
#include <includestream.h>
Classes | |
class | IncludeFilter |
Implements Filter interface for filterstreambuf. More... | |
Public Types | |
typedef std::list< std::string > | directories |
Type of optional second argument: a list of directories to search for included files. | |
Public Member Functions | |
includestream (std::istream &stream, directories *dirs=0) | |
Uses open stream. | |
includestream (std::istream &stream, const std::string &dir) | |
Uses open stream. | |
~includestream () | |
Destructor. | |
Static Public Member Functions | |
static std::string | find (const std::string &filename, const directories &dirs) |
Try to find a file d/filename for some directory d in dirs. | |
Private Attributes | |
IncludeFilter | filter_ |
A stream that can include other files.
An includestream is an istream that replaces lines of the form
#include "file" #include <file>
by the contents of the file
. If file
is between double quotes and is not absolute, it is interpreted as relative to the current directory. Otherwise (i.e. if it is of the form <file>
, it will be searched for (if it is not absolute) in a list of directories.
Definition at line 32 of file includestream.h.
typedef std::list<std::string> Dv::Util::includestream::directories |
Type of optional second argument: a list of directories to search for included files.
Definition at line 37 of file includestream.h.
Dv::Util::includestream::includestream | ( | std::istream & | stream, | |
directories * | dirs = 0 | |||
) |
Uses open stream.
stream | from which original input is taken | |
dirs | pointer (may be 0) to a list of directories to search if an include directive is of the <file> form. |
Dv::Util::includestream::includestream | ( | std::istream & | stream, | |
const std::string & | dir | |||
) |
Uses open stream.
stream | from which original input is taken | |
dir | a single directory to search if an include directive is of the <file> form. |
Dv::Util::includestream::~includestream | ( | ) |
Destructor.
static std::string Dv::Util::includestream::find | ( | const std::string & | filename, | |
const directories & | dirs | |||
) | [static] |
Try to find a file d/filename for some directory d in dirs.
Return zero-length string if not found. The directories are tried in order.
filename | (relative) path of filename. If filename is absolute, i.e. starts with / , only its existence (without considering dirs ) is checked. | |
dirs | list of directories to try |
Definition at line 116 of file includestream.h.
dvutil-1.0.10 | [ 5 December, 2009] |