stromx  0.8.0
Public Member Functions | List of all members
stromx::runtime::DirectoryFileInput Class Reference

File input which reads the input files from a common directory. More...

#include <DirectoryFileInput.h>

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

Public Member Functions

 DirectoryFileInput (const std::string &directory)
 
virtual void initialize (const std::string &text, const std::string &filename)
 
virtual std::istream & text ()
 
virtual bool hasFile () const
 
virtual std::istream & openFile (const OpenMode mode)
 
virtual std::istream & file ()
 
virtual void close ()
 

Additional Inherited Members

- Public Types inherited from stromx::runtime::InputProvider
enum  OpenMode { BINARY, TEXT }
 

Detailed Description

File input which reads the input files from a common directory.

Constructor & Destructor Documentation

§ DirectoryFileInput()

stromx::runtime::DirectoryFileInput::DirectoryFileInput ( const std::string &  directory)
inlineexplicit

Constructs a directory file input which reads files from a directory.

Parameters
directoryThe path to the directory.

Member Function Documentation

§ close()

void stromx::runtime::DirectoryFileInput::close ( )
virtual

Closes the file input. If this functions is not called the input is closed by the destructor.

Implements stromx::runtime::FileInput.

§ file()

std::istream & stromx::runtime::DirectoryFileInput::file ( )
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.

Implements stromx::runtime::InputProvider.

§ hasFile()

bool stromx::runtime::DirectoryFileInput::hasFile ( ) const
virtual

Returns true if a file representation of the data exists.

Implements stromx::runtime::InputProvider.

§ initialize()

void stromx::runtime::DirectoryFileInput::initialize ( const std::string &  text,
const std::string &  filename 
)
virtual

Initializes the file input to text and file data.

Parameters
textThe text data.
filenameThe name of the file which contains the file data. Pass an empty string if no file should be provided.

Implements stromx::runtime::FileInput.

§ openFile()

std::istream & stromx::runtime::DirectoryFileInput::openFile ( const OpenMode  mode)
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.

Implements stromx::runtime::InputProvider.

§ text()

std::istream & stromx::runtime::DirectoryFileInput::text ( )
virtual

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

Exceptions
WrongStateIf the input provider has not been correctly initialized.

Implements stromx::runtime::InputProvider.


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