INGOR
|
Expandable String Buffer. More...
#include <ytStrBuff.h>
Public Member Functions | |
ytStrBuff * | ytStrBuff_new () |
Generates the new ytStrBuff instance. | |
void | ytStrBuff_delete (void *this) |
Deletes the ytStrBuff instance. | |
ytObject * | ytStrBuff_obj (ytStrBuff *this) |
Returns the pointer to the ytObject instance. | |
ytStrBuff * | ytStrBuff_expand (ytStrBuff *this, size_t length) |
Expands the size of the allocated buffer memory. | |
ytStrBuff * | ytStrBuff_add (ytStrBuff *this, char c) |
Adds a character to the end of the buffer. | |
ytStrBuff * | ytStrBuff_addStr (ytStrBuff *this, const char *str) |
Adds a string to the end of the buffer. | |
size_t | ytStrBuff_length (const ytStrBuff *this) |
Returns the length of the string in the buffer. | |
size_t | ytStrBuff_len (const ytStrBuff *this) |
Returns the length of the string in the buffer. | |
const char * | ytStrBuff_str (const ytStrBuff *this) |
Returns the pointer pointing to the current string. | |
void * | ytStrBuff_ptr (const ytStrBuff *this) |
Returns the pointer pointing to the current string. | |
void | ytStrBuff_clear (ytStrBuff *this) |
Clears the buffer. | |
char * | ytStrBuff_gen (const ytStrBuff *this) |
Generates a new string identical to the string buffer. | |
Expandable String Buffer.
void ytStrBuff_clear | ( | ytStrBuff * | this | ) |
Clears the buffer.
this | pointer to the ytStrBuff. |
void ytStrBuff_delete | ( | void * | this | ) |
Deletes the ytStrBuff instance.
this | pointer to the ytStrBuff to be deleted. The pointer has to be one returned by ytStrBuff_new(). |
Expands the size of the allocated buffer memory.
The new buffer size will be the current size + length.
Generally this is used internally, and users do not need to use this directly.
this | pointer to the ytStrBuff instance. |
length | buffer size to be newly allocated. |
char * ytStrBuff_gen | ( | const ytStrBuff * | this | ) |
Generates a new string identical to the string buffer.
this | pointer to the ytStrBuff. |
size_t ytStrBuff_len | ( | const ytStrBuff * | this | ) |
Returns the length of the string in the buffer.
This returns the length of the string, excluding the terminal NULL letter.
This is the same as ytStrBuff_length().
this | pointer to the ytStrBuff instance. |
size_t ytStrBuff_length | ( | const ytStrBuff * | this | ) |
Returns the length of the string in the buffer.
This returns the length of the string, excluding the terminal NULL letter.
this | pointer to the ytStrBuff instance. |
ytStrBuff * ytStrBuff_new | ( | ) |
void * ytStrBuff_ptr | ( | const ytStrBuff * | this | ) |
Returns the pointer pointing to the current string.
If the buffer contains nothing, in other words, if no memory space is allocated for the buffer, then this returns NULL.
this | pointer to the ytStrBuff. |
const char * ytStrBuff_str | ( | const ytStrBuff * | this | ) |
Returns the pointer pointing to the current string.
If the buffer contains nothing, in other words, if no memory space is allocated for the buffer, then this returns the constant pointer to the empty string.
this | pointer to the ytStrBuff. |