Home | All Classes | Grouped Classes | Index | Search

Class CL_InputSource

Interface to read data. More...

Derived from: none
Derived by: CL_InputSource_File CL_InputSource_Memory CL_InputSource_NetPacket CL_InputSource_NetStream CL_InputSource_Socket CL_InputSource_Zipped
Group: Core (I/O Data)

#include <ClanLib/core.h>

Construction:

CL_InputSource

Input Source Constructor

Attributes:

tell

Returns current position in input source.

size

Returns the size of the input source

is_little_endian

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

Operations:

set_system_mode

Changes input data endianess to the local systems mode.

set_big_endian_mode

Changes input data endianess to big endian mode.

set_little_endian_mode

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

read_int64

Reads a signed 64 bit integer from input source.

read_uint64

Reads an unsigned 64 bit integer from input source.

read_int32

Reads a signed 32 bit integer from input source.

read_uint32

Reads an unsigned 32 bit integer from input source.

read_int16

Reads a signed 16 bit integer from input source.

read_uint16

Reads an unsigned 16 bit integer from input source.

read_int8

Reads a signed 8 bit integer from input source.

read_uint8

Reads an unsigned 8 bit integer from input source.

read_short16

Reads a signed 16 bit integer (short) from input source.

read_ushort16

Reads an unsigned 16 bit integer (short) from input source.

read_char8

Reads a signed 8 bit integer (char) from input source.

read_uchar8

Reads an unsigned 8 bit integer (char) from input source.

read_float32

Reads an ieee format floating point from input source.

read_float64

Reads an ieee format double from input source.

read_bool8

Reads a bool from input source.

read

Reads larger amounts of data (no endian and 64 bit conversion).

open

Opens the input source. By default, it is open.

close

Closes the input source.

clone

Make a copy of the current inputsource, standing at the same position.

read_string

Reads a string from the input source.

seek

Seeks to the specified position in the input source.

push_position

Pushes the current input source position. The position can be restored again with pop_position.

pop_position

Pops a previous pushed input source position (returns to the position).

Implementation:

little_endian_mode

Detailed description:

!group=Core/IO Data! !header=core.h!

CL_InputSource is used to read data from different types of input sources. In most cases, this is regular files and ClanLib zlib compressed datafiles.

To access some system specific input source types, such as datafiles and regular ones, use the static create functions in the CL_InputSourceProvider class.



Questions or comments, write to the
ClanLib mailing list.