OpenDaVINCI  4.16.0
odcore::io::StreamFactory Class Reference

#include <StreamFactory.h>

Public Member Functions

virtual ~StreamFactory ()
 
std::shared_ptr< istream > getInputStream (const URL &url) throw (odcore::exceptions::InvalidArgumentException)
 
std::shared_ptr< ostream > getOutputStream (const URL &url) throw (odcore::exceptions::InvalidArgumentException)
 

Static Public Member Functions

static StreamFactorygetInstance ()
 

Detailed Description

This class provides input and output streams.

Constructor & Destructor Documentation

odcore::io::StreamFactory::~StreamFactory ( )
virtual

Member Function Documentation

std::shared_ptr< istream > odcore::io::StreamFactory::getInputStream ( const URL url)
throw (odcore::exceptions::InvalidArgumentException
)

This method returns a new input stream based on a given URL.

Parameters
urlURL for the input stream
Returns
input stream based on the given URL.
Exceptions
InvalidArgumentExceptionin case of an invalid URL.

References odcore::io::URLProtocol::FILEPROTOCOL, OPENDAVINCI_CORE_DELETE_POINTER, and OPENDAVINCI_CORE_THROW_EXCEPTION.

StreamFactory & odcore::io::StreamFactory::getInstance ( )
static

This method returns a static instance for this factory.

Returns
Instance of this factory.

Referenced by odtools::recorder::Recorder::Recorder().

std::shared_ptr< ostream > odcore::io::StreamFactory::getOutputStream ( const URL url)
throw (odcore::exceptions::InvalidArgumentException
)

This method returns a new output stream based on a given URL.

Parameters
urlURL for the output stream
Returns
output stream based on the given URL.
Exceptions
InvalidArgumentExceptionin case of an invalid URL.

References odcore::io::URLProtocol::FILEPROTOCOL, OPENDAVINCI_CORE_DELETE_POINTER, and OPENDAVINCI_CORE_THROW_EXCEPTION.

Referenced by odtools::recorder::Recorder::Recorder().