|
sprint 1-alpha
|
the sprint::io namespace, which contains API to read and write from various device More...
Classes | |
| class | bzip2 |
| bzip2 stream file More... | |
| class | gzip |
| gzip file library More... | |
| class | mem |
| class | null |
| an IO who does nothing More... | |
| class | serial |
| a serial (es RS232) communication object More... | |
| class | stdiofile |
| class | tar |
| class | xadapter |
| struct | url_t |
| This struct contain any information able to open a xstream. More... | |
| class | xfolder |
| A single device. More... | |
| class | gzipf |
| class | xsocket |
| class | xstream |
| a virtual IO class More... | |
| struct | right |
| class | xtar |
| single tar file instance More... | |
| class | xtarf |
| Scrive un TAR facendo buffering e legge (solo sequenziale) attraverso un xs::xstream (unimplemented yet) More... | |
| class | xzip |
Typedefs | |
| typedef detail::file< false > | file_handle |
| a file handle (can be copied and destroy not close the handle) | |
| typedef detail::file< true > | file |
| a file (cannot be copied and destroy close the handle) | |
| typedef mem< true > | dynamic_buffer |
| dynamic buffer (buffer is responsible of release memory) | |
| typedef mem< false > | const_buffer |
| const buffer (user is responsible of release memory) | |
| typedef int | file_size_t |
| 32 bit file size: put here a 64 bit integer to switch to 64 bit version | |
| typedef xstream *(* | xProtocolCallback )(const url_t &url, void *param) |
| typedef xstream *(* | xExtensionCallback )(xstream *parent, void *param) |
| typedef xadapter< bzip2 > | xbzip2 |
| typedef xadapter < sprint::io::file > | xfile |
| typedef xadapter< ftp > | xftp |
| typedef xadapter< gzip > | xgzip |
| a xstream wrapper for sprint::io::gzip | |
| typedef xadapter< http > | xhttp |
| typedef xadapter < sprint::io::mem< true > > | xmem |
| typedef xadapter < sprint::io::mem< false > > | xconst_mem |
| typedef xadapter< null > | xnull |
| typedef xadapter < sprint::io::serial > | xserial |
| typedef xadapter< stdiofile > | xstdiofile |
| typedef void * | zipFile |
Enumerations | |
| enum | flag_t { def = 0, read = 1, write = 2, readwrite = 3, append = 4, create = 8 } |
| Implement - Indipendent. | |
| enum | state_t { unimplemented = 2, eof = -1, good = 0, error = 1 } |
| return on state | |
| enum | seek_t { start = 0, cur = 1, end = 2 } |
| return on state | |
| enum | caps_t { can_read = 1 << 0, can_write = 1 << 1, can_seek = 1 << 2, can_size = 1 << 3 } |
| stream capabilities More... | |
| enum | StreamProto { tcp, udp } |
| xsocket protocol selector | |
Functions | |
| BOOL | Win32_Serial_Write (HANDLE hComm, const char *lpBuf, DWORD dwToWrite) |
| win32 helper function to write on a serial in thread safe mode | |
| DWORD | Win32_Serial_Read (HANDLE hComm, char *buffer, DWORD buffer_lenght) |
| win32 helper function to read from a serial in thread safe mode | |
| void | register_protocol (const char *proto, xProtocolCallback proc, void *param) |
| Register a xstream factory protocol based associated with proto. | |
| void | register_extension (const char *extension, xExtensionCallback proc, void *param) |
| Register a xstream factory extension based associated with extension. | |
| xfolder * | open_folder_from_url (const url_t &url) |
| xfolder * | open_folder_from_url (const char *url) |
| xstream * | open_stream_from_url (const url_t &url) |
| xstream * | open_stream_from_url (const char *url) |
| unsigned int | copy (xstream *src, xstream *dst) |
| bool | readline (xstream *src, std::string &str, char eol) |
| bool | readline (xstream *src, char *buf, int buf_size, char eol) |
| xstream & | operator<< (xstream &out, const const_buffer &c) |
| put a buffer on stream | |
| xstream & | operator<< (xstream &out, char c) |
| put a single character on the stream | |
| xstream & | operator<< (xstream &out, const char *str) |
| put a string on the stream | |
| xstream & | operator<< (xstream &out, const std::string &str) |
| put a string on the stream | |
| xstream & | fill (xstream &out, int len, char c) |
| xstream & | operator<< (xstream &out, const right &r) |
the sprint::io namespace, which contains API to read and write from various device
| typedef xadapter<sprint::io::mem<false> > sprint::io::xconst_mem |
an xstream that works an user buffer
| typedef xadapter<sprint::io::file> sprint::io::xfile |
a virtual IO that use native and unbuffered file
Open a (native) file for write:
sprint::io::xfile out("out.png", sprint::io::write);
| typedef xadapter<sprint::io::mem<true> > sprint::io::xmem |
an xstream capable of store data in memory instead on hard device using a dynamic buffer
| typedef xstream*(* sprint::io::xProtocolCallback)(const url_t &url, void *param) |
TODO: spostarli in un altro file
a virtual IO for a serial device
sprint::io::xserial serial_line("COM1");
| typedef void* sprint::io::zipFile |
reserved
| enum sprint::io::caps_t |
| unsigned int sprint::io::copy | ( | xstream * | src, |
| xstream * | dst | ||
| ) |
copy all data from stream src to the stream dst
| xfolder* sprint::io::open_folder_from_url | ( | const url_t & | url | ) |
create a xfolder from a url
| url | is not a resource but a folder |
| xstream* sprint::io::open_stream_from_url | ( | const url_t & | url | ) |
create an xstream from a url
| url | have to be a resource |
| bool sprint::io::readline | ( | xstream * | src, |
| char * | buf, | ||
| int | buf_size, | ||
| char | eol | ||
| ) |
load a line from src in buf until eol
| bool sprint::io::readline | ( | xstream * | src, |
| std::string & | str, | ||
| char | eol | ||
| ) |
load a line from src in str until eol
1.7.4