A bytestream that writes its data into a string (array of unsigned char). The buffer automatically grows as data is written to it. The data can be retrieved using fts_memorystream_get_bytes()
Typedefs | |
| typedef struct fts_memorystream | fts_memorystream_t |
| FTS memorystream data type. | |
Functions | |
| FTS_API unsigned char * | fts_memorystream_get_bytes (fts_memorystream_t *stream) |
| Get the current content of the memorystream as a string (unsigned char *). | |
| FTS_API int | fts_memorystream_get_size (fts_memorystream_t *stream) |
| Get the size of a memorystream. | |
| FTS_API void | fts_memorystream_reset (fts_memorystream_t *stream) |
| Resets the stream to empty, so that all currently accumulated output is discarded. | |
Variables | |
| FTS_API fts_class_t * | fts_memorystream_class |
| The FTS memorystream class identifier (pointer to class instance). | |
| FTS_API unsigned char* fts_memorystream_get_bytes | ( | fts_memorystream_t * | stream | ) |
Get the current content of the memorystream as a string (unsigned char *).
The function returns a pointer to an internal buffer that shouldn't be modified.
Note: as the memorystream can reallocate its internal buffer when outputing a character to it, the value returned by this function must be considered invalid after the next output operation to the stream.
| stream | the memorystream |
| FTS_API int fts_memorystream_get_size | ( | fts_memorystream_t * | stream | ) |
Get the size of a memorystream.
| stream | the memory stream |
| FTS_API void fts_memorystream_reset | ( | fts_memorystream_t * | stream | ) |
Resets the stream to empty, so that all currently accumulated output is discarded.
| stream | the memory stream |
1.5.6