IOLink
IOL_v1.2.0_release
|
A factory to create StreamAccess instances from various ressources. More...
#include <iolink/storage/StreamAccessFactory.h>
Public Member Functions | |
StreamAccessFactory (const StreamAccessFactory &other)=delete | |
StreamAccessFactory (StreamAccessFactory &&other)=delete | |
StreamAccessFactory & | operator= (const StreamAccessFactory &other)=delete |
StreamAccessFactory & | operator= (StreamAccessFactory &&other)=delete |
Static Public Member Functions | |
static std::shared_ptr< StreamAccess > | allocate (size_t size=0) |
Create a stream in local memory. More... | |
static std::shared_ptr< StreamAccess > | copyInMemory (std::shared_ptr< StreamAccess > streamAccess) |
Load a stream into local memory. More... | |
static std::shared_ptr< StreamAccess > | fromStdStream (std::shared_ptr< std::istream > stream) |
Create a stream storage from a standard input stream. More... | |
static std::shared_ptr< StreamAccess > | fromStdStream (std::shared_ptr< std::ostream > stream) |
Create a stream storage from a standard output stream. More... | |
static std::shared_ptr< StreamAccess > | fromStdStream (std::shared_ptr< std::iostream > stream) |
Create a stream storage from a standard I/O stream. More... | |
static std::shared_ptr< std::istream > | toStdIStream (std::shared_ptr< StreamAccess > streamAccess) |
Create a standard Input stream from a StreamAccess. More... | |
static std::shared_ptr< std::ostream > | toStdOStream (std::shared_ptr< StreamAccess > streamAccess) |
Create a standard Output stream from a StreamAccess. More... | |
static std::shared_ptr< std::iostream > | toStdStream (std::shared_ptr< StreamAccess > streamAccess) |
Create a standard Input/Output stream from a StreamAccess. More... | |
static std::shared_ptr< StreamAccess > | openFileRead (const std::string &filePath) |
Create a stream that can read data from a file. More... | |
static std::shared_ptr< StreamAccess > | openFileWrite (const std::string &filePath) |
Create a stream that can write data to a file. More... | |
static std::shared_ptr< StreamAccess > | openFile (const std::string &filePath) |
Create a stream that can read and write data from/to a file. More... | |
static std::shared_ptr< StreamAccess > | openURIWrite (const Uri &uri) |
Create a stream that can write data to an URI. More... | |
static std::shared_ptr< StreamAccess > | openHTTPWrite (const Uri &uri, const std::string &method, const HTTPHeaders &headers) |
Create a stream that can post data to an HTTP URI. More... | |
static std::shared_ptr< StreamAccess > | fromRandomAccess (std::shared_ptr< RandomAccess > randomAccess) |
Create a StreamAccess that will delegate to a RandomAccess. More... | |
A factory to create StreamAccess instances from various ressources.
|
static |
Create a stream in local memory.
size | memory size (in byte) to allocate for the stream. |
read
, write
and seek
)
|
static |
Load a stream into local memory.
streamAccess | stream with at least read capability to load in memory |
read
, write
and seek
) InvalidArgument | if input streamAccess is null |
Error | if the input streamAccess has no read or seek capability |
|
static |
Create a StreamAccess that will delegate to a RandomAccess.
randomAccess | RandomAccess from which a StreamAccess is created |
read
, write
and seek
capability (see StreamAccessCapability) InvalidArgument | if input randomAccess is null |
Error | if the input randomAccess has nor read and write capability |
|
static |
Create a stream storage from a standard I/O stream.
stream | Standard I/O stream from which a StreamAccess is bridge is created |
read
, write
and seek
capabilities (see StreamAccessCapability)
|
static |
Create a stream storage from a standard input stream.
stream | Standard Input Stream on which a bridge is created |
seek
capability (see StreamAccessCapability)
|
static |
Create a stream storage from a standard output stream.
stream | Standard Output Stream on which a bridge is created |
seek
capability (see StreamAccessCapability)
|
static |
Create a stream that can read and write data from/to a file.
filePath | path toward the file which it's tried to access for reading and writing |
read
, write
and eventually seek
capability (see StreamAccessCapability)
|
static |
Create a stream that can read data from a file.
filePath | path toward the file which it's tried to access for reading |
seek
capability (see StreamAccessCapability)
|
static |
Create a stream that can write data to a file.
filePath | path toward the file which it's tried to access for writing |
seek
capability (see StreamAccessCapability)
|
static |
Create a stream that can post data to an HTTP URI.
HTTP server must support chunked transfer encoding.
uri | The HTTP(S) URI to post to. |
method | The HTTP request method. |
headers | The HTTP request headers. |
seek
capability (see StreamAccessCapability)
|
static |
Create a stream that can write data to an URI.
If the URI scheme is 'file': calls openFileWrite. If the URI scheme is 'http(s)': calls openHTTPWrite, using the POST method and no headers.
uri | URI to open for writing |
seek
capability (see StreamAccessCapability)
|
static |
Create a standard Input stream from a StreamAccess.
streamAccess | stream with read capability from which a bridge is created |
InvalidArgument | if input streamAccess is null |
|
static |
Create a standard Output stream from a StreamAccess.
streamAccess | StreamAccess with write capability from which a bridge is created |
InvalidArgument | if input streamAccess is null |
|
static |
Create a standard Input/Output stream from a StreamAccess.
streamAccess | stream with read and write and seek capability from which a bridge is created |
InvalidArgument | if input streamAccess is null |
InvalidArgument | if read , write , or seek capabilities is missing |