#include <iodevice.h>
Inheritance diagram for CL_IODevice:

Public Types | |
Enumerations | |
| enum | SeekMode { seek_set, seek_cur, seek_end } |
| Seeking modes. More... | |
Public Member Functions | |
Construction | |
| CL_IODevice () | |
| Constructs an I/O device. | |
| CL_IODevice (CL_IODeviceProvider *provider) | |
| Constructs a IODevice. | |
| ~CL_IODevice () | |
Attributes | |
| bool | is_null () const |
| Returns true if the iodevice is null. | |
| int | get_size () const |
| Returns the size of data stream. | |
| int | get_position () const |
| Returns the position in the data stream. | |
| bool | is_little_endian () const |
| Returns true if the input source is in little endian mode. | |
Operations | |
| int | send (const void *data, int len, bool send_all=true) |
| Send data to device. | |
| int | receive (void *data, int len, bool receive_all=true) |
| Receive data from device. | |
| int | peek (void *data, int len) |
| Peek data from device (data is left in the buffer). | |
| bool | seek (int position, SeekMode mode=seek_set) |
| Seek in data stream. | |
| int | read (void *data, int len, bool receive_all=true) |
| Alias for receive(data, len, receive_all). | |
| int | write (const void *data, int len, bool send_all=true) |
| Alias for send(data, len, send_all). | |
| void | set_system_mode () |
| Changes input data endianess to the local systems mode. | |
| void | set_big_endian_mode () |
| Changes input data endianess to big endian mode. (Default is little endian). | |
| void | set_little_endian_mode () |
| Changes input data endianess to little endian mode. This is the default setting. | |
| void | write_int64 (cl_int64 data) |
| Writes a signed 64 bit integer to output source. | |
| void | write_uint64 (cl_uint64 data) |
| Writes an unsigned 64 bit integer to output source. | |
| void | write_int32 (cl_int32 data) |
| Writes a signed 32 bit integer to output source. | |
| void | write_uint32 (cl_uint32 data) |
| Writes an unsigned 32 bit integer to output source. | |
| void | write_int16 (cl_int16 data) |
| Writes a signed 16 bit integer to output source. | |
| void | write_uint16 (cl_uint16 data) |
| Writes an unsigned 16 bit integer to output source. | |
| void | write_int8 (cl_int8 data) |
| Writes a signed 8 bit integer to output source. | |
| void | write_uint8 (cl_uint8 data) |
| Writes an unsigned 8 bit integer to output source. | |
| void | write_float (float data) |
| Writes a float to output source. | |
| void | write_string_a (const CL_StringRef8 &str) |
| Writes a string to the output source. | |
| cl_int64 | read_int64 () |
| Reads a signed 64 bit integer from input source. | |
| cl_uint64 | read_uint64 () |
| Reads an unsigned 64 bit integer from input source. | |
| cl_int32 | read_int32 () |
| Reads a signed 32 bit integer from input source. | |
| cl_uint32 | read_uint32 () |
| Reads an unsigned 32 bit integer from input source. | |
| cl_int16 | read_int16 () |
| Reads a signed 16 bit integer from input source. | |
| cl_uint16 | read_uint16 () |
| Reads an unsigned 16 bit integer from input source. | |
| cl_int8 | read_int8 () |
| Reads a signed 8 bit integer from input source. | |
| cl_uint8 | read_uint8 () |
| Reads an unsigned 8 bit integer from input source. | |
| float | read_float () |
| Reads a float from input source. | |
| CL_String8 | read_string_a () |
| Reads a string from the input source. | |
| CL_String8 | read_string_nul () |
| Reads a nul terminated string from the input source. | |
| CL_String8 | read_string_text (const char *skip_initial_chars, const char *read_until_chars, bool allow_eof=true) |
| Reads a string from the input source where the source is a text file. | |
| CL_IODevice | duplicate () |
| Create a new CL_IODevice referencing the same resource. | |
Protected Attributes | |
Implementation | |
| CL_SharedPtr< CL_IODevice_Impl > | impl |
This class can store basic datatypes and retain portability (using the specified endian mode)
The supported datatypes are: cl_int64, cl_int32, cl_int16 and cl_int8
The CL_String datatype is supported - Using Size(cl_int32), Charactor Data (CL_StringRef8 characters)
|
|
Seeking modes.
|
|
|
Constructs an I/O device.
|
|
|
Constructs a IODevice.
|
|
|
|
|
|
Create a new CL_IODevice referencing the same resource.
|
|
|
Returns the position in the data stream. Returns -1 if the position is unknown.
|
|
|
Returns the size of data stream. Returns -1 if the size is unknown.
|
|
|
Returns true if the input source is in little endian mode.
|
|
|
Returns true if the iodevice is null.
|
|
||||||||||||
|
Peek data from device (data is left in the buffer).
|
|
||||||||||||||||
|
Alias for receive(data, len, receive_all).
|
|
|
Reads a float from input source. Warning, this is not portable
|
|
|
Reads a signed 16 bit integer from input source.
|
|
|
Reads a signed 32 bit integer from input source.
|
|
|
Reads a signed 64 bit integer from input source.
|
|
|
Reads a signed 8 bit integer from input source.
|
|
|
Reads a string from the input source. The binary format expected in the input source is first an uint32 telling the length of the string, and then the string itself.
|
|
|
Reads a nul terminated string from the input source. The binary format expected in the input source is a nul terminated string. (The NUL termintor is read, so that the file position is set after the NUL)
|
|
||||||||||||||||
|
Reads a string from the input source where the source is a text file.
|
|
|
Reads an unsigned 16 bit integer from input source.
|
|
|
Reads an unsigned 32 bit integer from input source.
|
|
|
Reads an unsigned 64 bit integer from input source.
|
|
|
Reads an unsigned 8 bit integer from input source.
|
|
||||||||||||||||
|
Receive data from device.
|
|
||||||||||||
|
Seek in data stream.
|
|
||||||||||||||||
|
Send data to device. If the device databuffer is too small, it will be extended (ie grow memory block size or file size)
|
|
|
Changes input data endianess to big endian mode. (Default is little endian).
|
|
|
Changes input data endianess to little endian mode. This is the default setting.
|
|
|
Changes input data endianess to the local systems mode.
|
|
||||||||||||||||
|
Alias for send(data, len, send_all).
|
|
|
Writes a float to output source.
|
|
|
Writes a signed 16 bit integer to output source.
|
|
|
Writes a signed 32 bit integer to output source.
|
|
|
Writes a signed 64 bit integer to output source.
|
|
|
Writes a signed 8 bit integer to output source.
|
|
|
Writes a string to the output source.
|
|
|
Writes an unsigned 16 bit integer to output source.
|
|
|
Writes an unsigned 32 bit integer to output source.
|
|
|
Writes an unsigned 64 bit integer to output source.
|
|
|
Writes an unsigned 8 bit integer to output source.
|
|
|
|
1.4.6