MICO Platform
 All Classes Namespaces Functions Variables Friends
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mico::io::WebStreambufBase Class Reference

Base class for Boost Device implementations allowing to access remote (ftp://, http://, https://) URLs as stdio streams, similar to fstream. More...

#include <WebStream.hpp>

Inheritance diagram for mico::io::WebStreambufBase:
mico::io::WebIStreambuf mico::io::WebOStreambuf

Classes

union  handle_t
 

Public Member Functions

 WebStreambufBase (const char *url, URLMode mode, int bufsize)
 Open URL device using the given URL and flags. More...
 
virtual ~WebStreambufBase ()
 Clean up resources occupied by device, e.g. More...
 

Protected Member Functions

void loop ()
 loop to fetch/send more data
 

Protected Attributes

URLMode mode
 
handle_t handle
 
CURLM * multi_handle
 
int running_handles
 
char * buffer
 internal buffer for storing data from last read
 
int buffer_size
 allocated buffer size
 
char * buffer_position
 cURL position in buffer (when sending/receiving data)
 
bool finishing
 indicate if device is already finishing transfer (i.e. no more reads/writes)
 
bool waiting
 indicate if the device is still waiting for more data
 

Detailed Description

Base class for Boost Device implementations allowing to access remote (ftp://, http://, https://) URLs as stdio streams, similar to fstream.

Remote files are partly buffered in main memory.

The class is implemented using the Boost IOStreams library and uses the cURL library in the background to a access remote files.

Constructor & Destructor Documentation

mico::io::WebStreambufBase::WebStreambufBase ( const char *  url,
URLMode  mode,
int  bufsize 
)

Open URL device using the given URL and flags.

Uses cURL internally to access the server.

Parameters
urlthe full URL to the file (either starting with http://, https:// or ftp://)
modeopen mode, like for fopen; supported modes: read, write

Uses cURL internally to access the server.

Parameters
urlthe full URL to the file (either starting with http://, https:// or ftp://)
modeopen mode, like for fopen; supported modes: r, w; remote files cannot be opened for reading and writing at the same time
mico::io::WebStreambufBase::~WebStreambufBase ( )
virtual

Clean up resources occupied by device, e.g.

file handles and connections.


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