GATE
C/C++ Framework
Loading...
Searching...
No Matches
utilities.h File Reference

Miscellaneous utilities and helper functions. More...

#include "gate/gate_core_api.h"
#include "gate/gatetypes.h"
#include "gate/strings.h"
#include "gate/maps.h"
#include "gate/arrays.h"
#include "gate/streams.h"
#include "gate/typeids.h"

Functions

GATE_CORE_API gate_result_t gate_util_buffer_load (char const **ptrbuffer, gate_size_t *ptrbuffersize, gate_stream_t *srcstream, gate_memstream_t **membuffer)
 Deduces a content pointer and length from a source stream and optionally allocates a memorystream.

Detailed Description

Miscellaneous utilities and helper functions.

Function Documentation

◆ gate_util_buffer_load()

GATE_CORE_API gate_result_t gate_util_buffer_load ( char const ** ptrbuffer,
gate_size_t * ptrbuffersize,
gate_stream_t * srcstream,
gate_memstream_t ** membuffer )

Deduces a content pointer and length from a source stream and optionally allocates a memorystream.

An input memstream or stringstream will return their contents directly. Other streams are transferred into a new allocated memstream to access content pointers

Parameters
[out]ptrbufferpointer to char-pointer that is filled pointer to begin of content
[out]ptrbuffersizepointer to size that is filled with length of source stream
[in]srcstreaminput stream that's content is directly accessed or transferred
[in,out]membufferpointer to optionally created memstream that receives transferred data from srcstream
Returns
GATE_RESULT_* value