HTP
0.5
|
Functions | |
htp_status_t | bstr_builder_appendn (bstr_builder_t *bb, bstr *b) |
htp_status_t | bstr_builder_append_c (bstr_builder_t *bb, const char *cstr) |
htp_status_t | bstr_builder_append_mem (bstr_builder_t *bb, const void *data, size_t len) |
void | bstr_builder_clear (bstr_builder_t *bb) |
bstr_builder_t * | bstr_builder_create () |
void | bstr_builder_destroy (bstr_builder_t *bb) |
size_t | bstr_builder_size (const bstr_builder_t *bb) |
bstr * | bstr_builder_to_str (const bstr_builder_t *bb) |
htp_status_t 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. This function will make a copy of the provided string.
[in] | bb | |
[in] | cstr |
htp_status_t bstr_builder_append_mem | ( | bstr_builder_t * | bb, |
const void * | data, | ||
size_t | len | ||
) |
Adds one new piece, defined with the supplied pointer and length, to the builder. This function will make a copy of the provided data region.
[in] | bb | |
[in] | data | |
[in] | len |
htp_status_t bstr_builder_appendn | ( | bstr_builder_t * | bb, |
bstr * | b | ||
) |
Adds one new string to the builder. This function will adopt the string and destroy it when the builder itself is destroyed.
[in] | bb | |
[in] | b |
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.
[in] | 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.
[in] | bb |
size_t bstr_builder_size | ( | const bstr_builder_t * | bb | ) |
Returns the size (the number of pieces) currently in a string builder.
[in] | bb |
bstr* bstr_builder_to_str | ( | const 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.
[in] | bb |