GATE
Loading...
Searching...
No Matches
gate_controlstream_t Interface Reference

A stream that offers access to its internal native resource handles. More...

#include <streams.h>

Inheritance diagram for gate_controlstream_t:
gate_resourcestream_t gate_stream_t gate_object_t

Public Member Functions

gate_result_t can_read (gate_bool_t *return_value)
 Determines if a stream supports read() and/or peek() calls.
 
gate_result_t can_write (gate_bool_t *return_value)
 Determines if a stream supports write() and/or flush() calls.
 
gate_result_t get_size (gate_int64_t *return_value)
 Returns the currently known total content size of the stream, if available.
 
gate_result_t get_available (gate_int64_t *return_value)
 Determines how many bytes can be read from the stream until its end is reached.
 
gate_result_t seek (gate_int64_t position, gate_uint32_t origin, gate_int64_t *final_position)
 Moves the internal access pointer of a stream to a specific position.
 
gate_result_t reset ()
 Resets the stream to the state, when it was opened or created.
 
gate_result_t close (gate_uint32_t close_type)
 Closes or shuts down access to the contents of the stream.
 
- Public Member Functions inherited from gate_resourcestream_t
gate_result_t get_resource (gate_int32_t resource_type, gate_uintptr_t *resource_handle)
 Returns a resouce handle to the requested resource type (GATE_STREAM_RESOURCE_*)
 
- Public Member Functions inherited from gate_stream_t
gate_result_t read (char *buffer, gate_size_t bufferlength, gate_size_t *returned)
 Read bytes from stream and stores them in the given buffer.
 
gate_result_t peek (char *buffer, gate_size_t bufferlength, gate_size_t *returned)
 Tries to read bytes from the stream, but leaves them in its input buffer to be read again.
 
gate_result_t write (char const *buffer, gate_size_t bufferlength, gate_size_t *written)
 Writes bytes from the given buffer into the stream.
 
gate_result_t flush ()
 Instructs the stream to flush its internal buffers and make current status persistent.
 
- Public Member Functions inherited from gate_object_t
char const * get_interface_name ()
 Returns on object's interface path name.
 
void release ()
 Decrease object's reference counter, releases the object when count reaches zero.
 
int retain ()
 Increase object's reference counter.
 

Detailed Description

A stream that offers access to its internal native resource handles.

Member Function Documentation

◆ can_read()

gate_result_t can_read ( gate_bool_t * return_value)

Determines if a stream supports read() and/or peek() calls.

Parameters
[out]return_valuePointer to boolean to be initialized with true, if stream is readable
Returns
GATE_RESULT_* result code

◆ can_write()

gate_result_t can_write ( gate_bool_t * return_value)

Determines if a stream supports write() and/or flush() calls.

Parameters
[out]return_valuePointer to boolean to be initialized with true, if stream is writable
Returns
GATE_RESULT_* result code

◆ get_size()

gate_result_t get_size ( gate_int64_t * return_value)

Returns the currently known total content size of the stream, if available.

Parameters
[out]return_valuePointer to integer to be initialized with total content size of stream
Returns
GATE_RESULT_* result code

◆ get_available()

gate_result_t get_available ( gate_int64_t * return_value)

Determines how many bytes can be read from the stream until its end is reached.

Parameters
[out]return_valuePointer to integer to be initialized with available/readable bytes in stream
Returns
GATE_RESULT_* result code

◆ seek()

gate_result_t seek ( gate_int64_t position,
gate_uint32_t origin,
gate_int64_t * final_position )

Moves the internal access pointer of a stream to a specific position.

Parameters
[in]positionRelative position in bytes within the stream relative to origin
[in]originGATE_STREAM_SEEK_* value defining the origin of the move operation
[out]final_positionPointer to integer to be initialized with the absolute position within the stream (relative to begin)
Returns
GATE_RESULT_* result code

◆ reset()

gate_result_t reset ( )

Resets the stream to the state, when it was opened or created.

Returns
GATE_RESULT_* result code

◆ close()

gate_result_t close ( gate_uint32_t close_type)

Closes or shuts down access to the contents of the stream.

Parameters
[in]close_typeGATE_STREAM_CLOSE_* value defining which part of the stream should be closed
Returns
GATE_RESULT_* result code

The documentation for this interface was generated from the following file: