stromx  0.8.0
Public Types | Public Member Functions | List of all members
stromx::runtime::InputProvider Class Referenceabstract

Provides functions to deserialize data from strings and files. More...

#include <InputProvider.h>

Inheritance diagram for stromx::runtime::InputProvider:
stromx::runtime::FileInput stromx::runtime::DirectoryFileInput stromx::runtime::ZipFileInput

Public Types

enum  OpenMode { BINARY, TEXT }
 

Public Member Functions

virtual std::istream & text ()=0
 
virtual bool hasFile () const =0
 
virtual std::istream & openFile (const OpenMode mode=BINARY)=0
 
virtual std::istream & file ()=0
 

Detailed Description

Provides functions to deserialize data from strings and files.

Member Enumeration Documentation

§ OpenMode

The possible modes for file access.

Enumerator
BINARY 

Access the file as binary file.

TEXT 

Access the file as text file.

Member Function Documentation

§ file()

virtual std::istream& stromx::runtime::InputProvider::file ( )
pure virtual

Returns the input stream with the file representation of the data.

Exceptions
WrongStateIf the input provider has not been correctly initialized or if openFile() has not been called before calling this function.

Implemented in stromx::runtime::ZipFileInput, and stromx::runtime::DirectoryFileInput.

§ hasFile()

virtual bool stromx::runtime::InputProvider::hasFile ( ) const
pure virtual

Returns true if a file representation of the data exists.

Implemented in stromx::runtime::ZipFileInput, and stromx::runtime::DirectoryFileInput.

§ openFile()

virtual std::istream& stromx::runtime::InputProvider::openFile ( const OpenMode  mode = BINARY)
pure virtual

Opens the file representation of the data and returns the associated input stream.

Exceptions
NoInputFileIf no file is provided.
WrongStateIf the input provider has not been correctly initialized or if this function has already been called.
FileAccessFailedIf the file could not be opened.

Implemented in stromx::runtime::ZipFileInput, and stromx::runtime::DirectoryFileInput.

§ text()

virtual std::istream& stromx::runtime::InputProvider::text ( )
pure virtual

Returns an input stream with the text representation of the data.

Exceptions
WrongStateIf the input provider has not been correctly initialized.

Implemented in stromx::runtime::ZipFileInput, and stromx::runtime::DirectoryFileInput.


The documentation for this class was generated from the following file: