#include <InputStream.h>
Public Member Functions | |
| InputStream () | |
Default ctor providing std::cin. | |
| InputStream (std::istream &stream_r, const std::string &name_r=std::string()) | |
Ctor providing an aleady existig std::istream. | |
| InputStream (const Pathname &file_r) | |
| Ctor for reading a (gziped) file. | |
| InputStream (const Pathname &file_r, const std::string &name_r) | |
| Ctor for reading a (gziped) file. | |
| InputStream (const std::string &file_r) | |
| Ctor for reading a (gziped) file. | |
| InputStream (const std::string &file_r, const std::string &name_r) | |
| Ctor for reading a (gziped) file. | |
| InputStream (const char *file_r) | |
| Ctor for reading a (gziped) file. | |
| InputStream (const char *file_r, const std::string &name_r) | |
| Ctor for reading a (gziped) file. | |
| ~InputStream () | |
| Dtor. | |
| std::istream & | stream () const |
| The std::istream. | |
| operator std::istream & () const | |
| Allow implicit conversion to std::istream. | |
| const std::string & | name () const |
| Name of the std::istream. | |
| const Pathname & | path () const |
| Path to the input file or empty if no file. | |
Private Attributes | |
| Pathname | _path |
| shared_ptr< std::istream > | _stream |
| std::string | _name |
Related Functions | |
| (Note that these are not member functions.) | |
| std::ostream & | operator<< (std::ostream &str, const InputStream &obj) |
The provided std::istream may either be std::cin, sone (gziped) file or an aleady existig std::istream.
An optional name arument may be passed to the ctor, to identify the stream in log messages, even if it is not a file.
Per default the name is "STDIN", the path to an input file or empty.
void parse( const InputStream & input = InputStream() ) { // process input.stream() and refer to input.name() // in log messages. } parse(); // std::cin parse( "/some/file" ); // file parse( "/some/file.gz" ); // gziped file std::istream & mystream; parse( mystream ); // some existing stream parse( InputStream( mystream, "my stream's name" ) );
Definition at line 55 of file InputStream.h.
|
|
Default ctor providing
Definition at line 29 of file InputStream.cc. |
|
||||||||||||
|
Ctor providing an aleady existig
Definition at line 39 of file InputStream.cc. |
|
|
Ctor for reading a (gziped) file.
Definition at line 50 of file InputStream.cc. |
|
||||||||||||
|
Ctor for reading a (gziped) file.
Definition at line 61 of file InputStream.cc. |
|
|
Ctor for reading a (gziped) file.
Definition at line 73 of file InputStream.cc. |
|
||||||||||||
|
Ctor for reading a (gziped) file.
Definition at line 84 of file InputStream.cc. |
|
|
Ctor for reading a (gziped) file.
Definition at line 96 of file InputStream.cc. |
|
||||||||||||
|
Ctor for reading a (gziped) file.
Definition at line 107 of file InputStream.cc. |
|
|
Dtor.
Definition at line 119 of file InputStream.cc. |
|
|
The std::istream.
Definition at line 92 of file InputStream.h. References _stream. Referenced by zypp::operator<<(), and zypp::xml::Reader::Reader(). |
|
|
Allow implicit conversion to std::istream.
Definition at line 96 of file InputStream.h. References _stream. |
|
|
Name of the std::istream. Per default this is "STDIN", the path to an input file or empty. A custom string may be provided to the ctor. This may be used in log messages to identify the stream even even if it is not a file. Definition at line 106 of file InputStream.h. Referenced by zypp::operator<<(), and zypp::parser::IniParser::parse(). |
|
|
Path to the input file or empty if no file.
Definition at line 110 of file InputStream.h. |
|
||||||||||||
|
Stream output Definition at line 127 of file InputStream.cc. |
|
|
Definition at line 114 of file InputStream.h. |
|
|
Definition at line 115 of file InputStream.h. Referenced by operator std::istream &(), and stream(). |
|
|
Definition at line 116 of file InputStream.h. |
1.4.6