bstr_builder.c File Reference

#include "bstr.h"
#include "bstr_builder.h"
#include "dslib.h"
Include dependency graph for bstr_builder.c:

Functions

size_t bstr_builder_size (bstr_builder_t *bb)
void bstr_builder_clear (bstr_builder_t *bb)
bstr_builder_tbstr_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)
bstrbstr_builder_to_str (bstr_builder_t *bb)

Detailed Description

Author:
Ivan Ristic <ivanr@webkreator.com>

Function Documentation

int bstr_builder_append ( bstr_builder_t bb,
bstr b 
)

Adds one new string to the builder.

Parameters:
bb 
b 
Returns:
Success indication
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.

Parameters:
bb 
cstr 
Returns:
Success indication

Here is the call graph for this function:

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.

Parameters:
bb 
data 
len 
Returns:
Success indication

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
bb 

Here is the call graph for this function:

Here is the caller graph for this function:

bstr_builder_t* bstr_builder_create ( void   ) 

Creates a new string builder.

Returns:
New string builder

Here is the call graph for this function:

Here is the caller graph for this function:

void bstr_builder_destroy ( bstr_builder_t bb  ) 

Destroys an existing string builder, also destroying all the pieces stored within.

Parameters:
bb 

Here is the call graph for this function:

Here is the caller graph for this function:

size_t bstr_builder_size ( bstr_builder_t bb  ) 

Returns the size (the number of pieces) currently in a string builder.

Parameters:
bb 
Returns:
size

Here is the caller graph for this function:

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.

Parameters:
bb 
Returns:
New string

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on 28 Jan 2013 for HTP by  doxygen 1.6.1