strigi/src/streams
Strigi::SubStreamProvider Class Reference
Extracts substreams from an InputStream. More...
#include <substreamprovider.h>

Public Member Functions | |
| SubStreamProvider (InputStream *input) | |
| virtual | ~SubStreamProvider () |
| InputStream * | currentEntry () |
| const EntryInfo & | entryInfo () const |
| const char * | error () const |
| virtual InputStream * | nextEntry ()=0 |
| StreamStatus | status () const |
Protected Attributes | |
| EntryInfo | m_entryinfo |
| InputStream * | m_entrystream |
| std::string | m_error |
| InputStream * | m_input |
| StreamStatus | m_status |
Detailed Description
Extracts substreams from an InputStream.
This class extracts substreams, such as files and directories, from an InputStream. For example, it may extract files and directories from a tar archive, or uncompressed data from a gzipped data stream.
Definition at line 67 of file substreamprovider.h.
Constructor & Destructor Documentation
| Strigi::SubStreamProvider::SubStreamProvider | ( | InputStream * | input | ) | [inline] |
Initialize the SubStreamProvider.
This just sets the members to sane defaults, and assigns input to m_input
- Parameters:
-
input the inputstream that will be split into substreams
Definition at line 91 of file substreamprovider.h.
| virtual Strigi::SubStreamProvider::~SubStreamProvider | ( | ) | [inline, virtual] |
Releases the memory used by entrystream, if there is one.
NB: does not delete input
Definition at line 101 of file substreamprovider.h.
Member Function Documentation
| InputStream* Strigi::SubStreamProvider::currentEntry | ( | ) | [inline] |
get the current substream
Definition at line 140 of file substreamprovider.h.
| const EntryInfo& Strigi::SubStreamProvider::entryInfo | ( | ) | const [inline] |
get information about the current substream
Definition at line 147 of file substreamprovider.h.
| const char* Strigi::SubStreamProvider::error | ( | ) | const [inline] |
Return a string representation of the last error.
If no error has occurred, an empty string is returned.
Definition at line 155 of file substreamprovider.h.
| virtual InputStream* Strigi::SubStreamProvider::nextEntry | ( | ) | [pure virtual] |
Get the next substream.
This function should return a stream representing the next substream that can be read from the input stream, or 0 if there are no more substreams.
For example, if the input stream were a tar archive, it would return a stream representing the next file or directory in the archive.
It should also load the substream (the same one that was returned) into entrystream, and set entryinfo to an EntryInfo giving information about the substream.
If there may be more substreams, but an error occurred, 0 should be returned, the status should be set to Error and an error message should be set.
- Returns:
- the next substream, or 0 if there are no more substreams or an error occurred
Implemented in Strigi::ArInputStream, Strigi::CpioInputStream, Strigi::MailInputStream, Strigi::OleInputStream, Strigi::RpmInputStream, Strigi::SdfInputStream, Strigi::TarInputStream, and Strigi::ZipInputStream.
| StreamStatus Strigi::SubStreamProvider::status | ( | ) | const [inline] |
Return the status of the stream.
Definition at line 110 of file substreamprovider.h.
Member Data Documentation
EntryInfo Strigi::SubStreamProvider::m_entryinfo [protected] |
Information about the current substream.
Definition at line 81 of file substreamprovider.h.
InputStream* Strigi::SubStreamProvider::m_entrystream [protected] |
The current substream.
Definition at line 79 of file substreamprovider.h.
std::string Strigi::SubStreamProvider::m_error [protected] |
String representation of the last error, or an empty string otherwise.
Definition at line 75 of file substreamprovider.h.
InputStream* Strigi::SubStreamProvider::m_input [protected] |
The input stream to extract the substreams from.
Definition at line 77 of file substreamprovider.h.
StreamStatus Strigi::SubStreamProvider::m_status [protected] |
The status of the SubStreamProvider.
Definition at line 70 of file substreamprovider.h.
The documentation for this class was generated from the following file:
KDE 4.4 API Reference