CL_IODevice_Memory Class Reference
[clanCore I/O Data]

Memory I/O device. More...

#include <iodevice_memory.h>

Inheritance diagram for CL_IODevice_Memory:

CL_IODevice List of all members.

Public Member Functions

Construction
 CL_IODevice_Memory ()
 Constructs a memory I/O device.
 CL_IODevice_Memory (CL_DataBuffer &data)
 Constructs a IODevice Memory.
Attributes
const CL_DataBufferget_data () const
 Retrieves the data buffer for the memory device.
CL_DataBufferget_data ()
 Get Data.

Detailed Description

Memory I/O device.


Member Enumeration Documentation

enum CL_IODevice::SeekMode [inherited]
 

Seeking modes.

Enumerator:
seek_set  Set to a specific value from the start.
seek_cur  Set relative to the current position.
seek_end  Set to a specific value from the end (use negative position).


Constructor & Destructor Documentation

CL_IODevice_Memory::CL_IODevice_Memory  ) 
 

Constructs a memory I/O device.

CL_IODevice_Memory::CL_IODevice_Memory CL_DataBuffer data  ) 
 

Constructs a IODevice Memory.

Parameters:
data = Data Buffer


Member Function Documentation

CL_IODevice CL_IODevice::duplicate  )  [inherited]
 

Create a new CL_IODevice referencing the same resource.

CL_DataBuffer& CL_IODevice_Memory::get_data  ) 
 

Get Data.

Returns:
data

const CL_DataBuffer& CL_IODevice_Memory::get_data  )  const
 

Retrieves the data buffer for the memory device.

int CL_IODevice::get_position  )  const [inherited]
 

Returns the position in the data stream.

Returns -1 if the position is unknown.

Returns:
The size (-1 if position is unknown)

int CL_IODevice::get_size  )  const [inherited]
 

Returns the size of data stream.

Returns -1 if the size is unknown.

Returns:
The size (-1 if size is unknown)

bool CL_IODevice::is_little_endian  )  const [inherited]
 

Returns true if the input source is in little endian mode.

Returns:
true if little endian

bool CL_IODevice::is_null  )  const [inherited]
 

Returns true if the iodevice is null.

int CL_IODevice::peek void *  data,
int  len
[inherited]
 

Peek data from device (data is left in the buffer).

Parameters:
data Data to receive
len Maximum length of data to receive
Returns:
size of data received.

int CL_IODevice::read void *  data,
int  len,
bool  receive_all = true
[inherited]
 

Alias for receive(data, len, receive_all).

Parameters:
data Data to receive
len Length to receive
send_all true to receive all the data. false = receive part of the data, if it would block
Returns:
size of data received

float CL_IODevice::read_float  )  [inherited]
 

Reads a float from input source.

Warning, this is not portable

Returns:
The float read.

cl_int16 CL_IODevice::read_int16  )  [inherited]
 

Reads a signed 16 bit integer from input source.

Returns:
The integer read.

cl_int32 CL_IODevice::read_int32  )  [inherited]
 

Reads a signed 32 bit integer from input source.

Returns:
The integer read.

cl_int64 CL_IODevice::read_int64  )  [inherited]
 

Reads a signed 64 bit integer from input source.

Returns:
The integer read.

cl_int8 CL_IODevice::read_int8  )  [inherited]
 

Reads a signed 8 bit integer from input source.

Returns:
The integer read.

CL_String8 CL_IODevice::read_string_a  )  [inherited]
 

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.

Returns:
The string read.

CL_String8 CL_IODevice::read_string_nul  )  [inherited]
 

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)

Returns:
The string read.

CL_String8 CL_IODevice::read_string_text const char *  skip_initial_chars,
const char *  read_until_chars,
bool  allow_eof = true
[inherited]
 

Reads a string from the input source where the source is a text file.

Parameters:
skip_initital_chars Ignore any of these characters at the start of the string. NULL = Do not ignore any characters
read_until_chars Read from the input until any of these characters are found. NULL = Read until the end of the file
Returns:
The string read.
After reading the input source up to "read_until_chars", the file position is set to the first character that was not read. If the file contains NUL characters, then the input is read up to the NUL character, and the file position is set AFTER the NUL)

cl_uint16 CL_IODevice::read_uint16  )  [inherited]
 

Reads an unsigned 16 bit integer from input source.

Returns:
The integer read.

cl_uint32 CL_IODevice::read_uint32  )  [inherited]
 

Reads an unsigned 32 bit integer from input source.

Returns:
The integer read.

cl_uint64 CL_IODevice::read_uint64  )  [inherited]
 

Reads an unsigned 64 bit integer from input source.

Returns:
The integer read.

cl_uint8 CL_IODevice::read_uint8  )  [inherited]
 

Reads an unsigned 8 bit integer from input source.

Returns:
The integer read.

int CL_IODevice::receive void *  data,
int  len,
bool  receive_all = true
[inherited]
 

Receive data from device.

Parameters:
data Data to receive
len Length to receive
send_all true to receive all the data. false = receive part of the data, if it would block
Returns:
size of data received

bool CL_IODevice::seek int  position,
SeekMode  mode = seek_set
[inherited]
 

Seek in data stream.

Parameters:
position Position to use (usage depends on the seek mode)
mode Seek mode
Returns:
false = Failed

int CL_IODevice::send const void *  data,
int  len,
bool  send_all = true
[inherited]
 

Send data to device.

If the device databuffer is too small, it will be extended (ie grow memory block size or file size)

Parameters:
data Data to send
len Length to send
send_all true to send all the data. false = send part of the data, if it would block
Returns:
size of data sent

void CL_IODevice::set_big_endian_mode  )  [inherited]
 

Changes input data endianess to big endian mode. (Default is little endian).

void CL_IODevice::set_little_endian_mode  )  [inherited]
 

Changes input data endianess to little endian mode. This is the default setting.

void CL_IODevice::set_system_mode  )  [inherited]
 

Changes input data endianess to the local systems mode.

int CL_IODevice::write const void *  data,
int  len,
bool  send_all = true
[inherited]
 

Alias for send(data, len, send_all).

Parameters:
data Data to send
len Length to send
send_all true to send all the data. false = send part of the data, if it would block
Returns:
size of data sent

void CL_IODevice::write_float float  data  )  [inherited]
 

Writes a float to output source.

Parameters:
data = Float to write
Warning, this is not portable.

void CL_IODevice::write_int16 cl_int16  data  )  [inherited]
 

Writes a signed 16 bit integer to output source.

Parameters:
data Integer to write

void CL_IODevice::write_int32 cl_int32  data  )  [inherited]
 

Writes a signed 32 bit integer to output source.

Parameters:
data Integer to write

void CL_IODevice::write_int64 cl_int64  data  )  [inherited]
 

Writes a signed 64 bit integer to output source.

Parameters:
data Integer to write

void CL_IODevice::write_int8 cl_int8  data  )  [inherited]
 

Writes a signed 8 bit integer to output source.

Parameters:
data Integer to write

void CL_IODevice::write_string_a const CL_StringRef8 str  )  [inherited]
 

Writes a string to the output source.

Parameters:
str String to write
The binary format written to the output source is first an uint32 telling the length of the string, and then the string itself.

void CL_IODevice::write_uint16 cl_uint16  data  )  [inherited]
 

Writes an unsigned 16 bit integer to output source.

Parameters:
data Integer to write

void CL_IODevice::write_uint32 cl_uint32  data  )  [inherited]
 

Writes an unsigned 32 bit integer to output source.

Parameters:
data Integer to write

void CL_IODevice::write_uint64 cl_uint64  data  )  [inherited]
 

Writes an unsigned 64 bit integer to output source.

Parameters:
data Integer to write

void CL_IODevice::write_uint8 cl_uint8  data  )  [inherited]
 

Writes an unsigned 8 bit integer to output source.

Parameters:
data Integer to write


Member Data Documentation

CL_SharedPtr<CL_IODevice_Impl> CL_IODevice::impl [protected, inherited]
 


The documentation for this class was generated from the following file:
Generated on Thu Dec 3 02:39:38 2009 for ClanLib by  doxygen 1.4.6