#include "bstr.h"
#include "bstr_builder.h"
#include "dslib.h"
Functions | |
size_t | bstr_builder_size (bstr_builder_t *bb) |
void | bstr_builder_clear (bstr_builder_t *bb) |
bstr_builder_t * | bstr_builder_create () |
void | bstr_builder_destroy (bstr_builder_t *bb) |
int | bstr_builder_append (bstr_builder_t *bb, bstr *b) |
int | bstr_builder_append_mem (bstr_builder_t *bb, const char *data, size_t len) |
int | bstr_builder_append_c (bstr_builder_t *bb, const char *cstr) |
bstr * | bstr_builder_to_str (bstr_builder_t *bb) |
int bstr_builder_append | ( | bstr_builder_t * | bb, | |
bstr * | b | |||
) |
Adds one new string to the builder.
bb | ||
b |
int bstr_builder_append_c | ( | bstr_builder_t * | bb, | |
const char * | cstr | |||
) |
Adds one new piece, in the form of a NUL-terminated string, to the builder.
bb | ||
cstr |
int bstr_builder_append_mem | ( | bstr_builder_t * | bb, | |
const char * | data, | |||
size_t | len | |||
) |
Adds one new piece, defined with the supplied pointer and length, to the builder.
bb | ||
data | ||
len |
void bstr_builder_clear | ( | bstr_builder_t * | bb | ) |
Clears this string builder, destroying all existing pieces. You may want to clear a builder once you've either read all the pieces and done something with them, or after you've converted the builder into a single string.
bb |
bstr_builder_t* bstr_builder_create | ( | void | ) |
Creates a new string builder.
void bstr_builder_destroy | ( | bstr_builder_t * | bb | ) |
Destroys an existing string builder, also destroying all the pieces stored within.
bb |
size_t bstr_builder_size | ( | bstr_builder_t * | bb | ) |
Returns the size (the number of pieces) currently in a string builder.
bb |
bstr* bstr_builder_to_str | ( | bstr_builder_t * | bb | ) |
Creates a single string out of all the pieces held in a string builder. This method will not destroy any of the pieces.
bb |