MOD_IOLAYER_MEMORY
[MOD_IOLAYER]


Constructors

GWENHYWFAR_API GWEN_IO_LAYERGWEN_Io_LayerMemory_fromString (const uint8_t *p, int size)
GWENHYWFAR_API GWEN_IO_LAYERGWEN_Io_LayerMemory_new (GWEN_BUFFER *buffer)

Informational Functions

GWENHYWFAR_API GWEN_BUFFERGWEN_Io_LayerMemory_GetBuffer (const GWEN_IO_LAYER *io)

Makro Defining the Type Name

#define GWEN_IO_LAYER_MEMORY_TYPE   "memory"

Detailed Description

This module uses a GWEN_BUFFER object to read/write data.. It supports the following request types:

An io layer of this module is an endpoint since it has no base layer.

This io layer always handles request directly upon GWEN_Io_Layer_AddRequest() so when that function returns the given request is already finished.


Define Documentation

#define GWEN_IO_LAYER_MEMORY_TYPE   "memory"

Definition at line 52 of file io_memory.h.

Referenced by GWEN_Io_LayerMemory_new().


Function Documentation

GWENHYWFAR_API GWEN_IO_LAYER* GWEN_Io_LayerMemory_fromString ( const uint8_t *  p,
int  size 
)

Creates a new IO layer using the given data. This function internally creates a GWEN_BUFFER and calls GWEN_Io_LayerMemory_new() with it. After that it sets the flag GWEN_IO_LAYER_MEMORY_FLAGS_TAKEOVER to make the new io layer take over the just created buffer. Such an io layer can immediately by used to read data from.

Parameters:
p pointer to the string from which the internal buffer is to filled.
size size of the string pointed to by p (use -1 to make this function calculate the size using strlen)

Definition at line 64 of file io_memory.c.

References GWEN_Buffer_AppendBytes(), GWEN_Buffer_new(), GWEN_Buffer_Rewind(), GWEN_Io_Layer_AddFlags(), GWEN_IO_LAYER_FLAGS_TAKEOVER, and GWEN_Io_LayerMemory_new().

Referenced by GWEN_DB_ReadFromString(), and GWEN_XMLNode_fromString().

GWENHYWFAR_API GWEN_BUFFER* GWEN_Io_LayerMemory_GetBuffer ( const GWEN_IO_LAYER io  ) 

Return a pointer to the internally used GWEN_BUFFER. Please note that if the flag GWEN_IO_LAYER_MEMORY_FLAGS_TAKEOVER is set when this io layer is free'd the GWEN_BUFFER will also be free'd!

Definition at line 102 of file io_memory.c.

References GWEN_INHERIT_GETDATA.

GWENHYWFAR_API GWEN_IO_LAYER* GWEN_Io_LayerMemory_new ( GWEN_BUFFER buffer  ) 


Generated on Wed Jul 9 13:12:30 2008 for gwenhywfar by  doxygen 1.5.6