Top |
raptor_stringbuffer * | raptor_new_stringbuffer () |
void | raptor_free_stringbuffer () |
int | raptor_stringbuffer_append_counted_string () |
int | raptor_stringbuffer_append_decimal () |
int | raptor_stringbuffer_append_hexadecimal () |
int | raptor_stringbuffer_append_string () |
int | raptor_stringbuffer_append_stringbuffer () |
int | raptor_stringbuffer_append_uri_escaped_counted_string () |
int | raptor_stringbuffer_prepend_counted_string () |
int | raptor_stringbuffer_prepend_string () |
unsigned char * | raptor_stringbuffer_as_string () |
size_t | raptor_stringbuffer_length () |
int | raptor_stringbuffer_copy_to_string () |
int | raptor_stringbuffer_write () |
raptor_stringbuffer *
raptor_new_stringbuffer (void
);
Create a new stringbuffer.
void
raptor_free_stringbuffer (raptor_stringbuffer *stringbuffer
);
Destroy a stringbuffer.
int raptor_stringbuffer_append_counted_string (raptor_stringbuffer *stringbuffer
,const char *string
,size_t length
,int do_copy
);
Add a counted string to the stringbuffer.
If string
is NULL or length
is 0, no work is performed.
If do_copy
is non-0, the passed-in string is copied into new memory
otherwise the stringbuffer becomes the owner of the string pointer
and will free it when the stringbuffer is destroyed.
int raptor_stringbuffer_append_decimal (raptor_stringbuffer *stringbuffer
,int integer
);
Add an integer in decimal to the stringbuffer.
int raptor_stringbuffer_append_hexadecimal (raptor_stringbuffer *stringbuffer
,int hex
);
Add an integer formatted in hexdecimal (base 16) to the stringbuffer.
int raptor_stringbuffer_append_string (raptor_stringbuffer *stringbuffer
,const char *string
,int do_copy
);
Add a string to the stringbuffer.
If string
is NULL, no work is performed.
If do_copy
is non-0, the passed-in string is copied into new memory
otherwise the stringbuffer becomes the owner of the string pointer
and will free it when the stringbuffer is destroyed.
int raptor_stringbuffer_append_stringbuffer (raptor_stringbuffer *stringbuffer
,raptor_stringbuffer *append
);
Add a stringbuffer to the stringbuffer.
This function removes the content from the appending stringbuffer, making it empty and appends it to the supplied stringbuffer.
int raptor_stringbuffer_append_uri_escaped_counted_string (raptor_stringbuffer *sb
,const char *string
,size_t length
,int space_is_plus
);
Add a URI-escaped version of string
to the stringbuffer.
If string
is NULL or length
is 0, no work is performed.
int raptor_stringbuffer_prepend_counted_string (raptor_stringbuffer *stringbuffer
,const char *string
,size_t length
,int do_copy
);
If do_copy is non-0, the passed-in string is copied into new memory otherwise the stringbuffer becomes the owner of the string pointer and will free it when the stringbuffer is destroyed.
Add a string to the start of the stringbuffer.
int raptor_stringbuffer_prepend_string (raptor_stringbuffer *stringbuffer
,const char *string
,int do_copy
);
Add a string to the start of the stringbuffer.
If do_copy is non-0, the passed-in string is copied into new memory otherwise the stringbuffer becomes the owner of the string pointer and will free it when the stringbuffer is destroyed.
unsigned char *
raptor_stringbuffer_as_string (raptor_stringbuffer *stringbuffer
);
Return the stringbuffer as a C string.
Note: the return value is a to a shared string that the stringbuffer allocates and manages.
size_t
raptor_stringbuffer_length (raptor_stringbuffer *stringbuffer
);
Return the stringbuffer length.
int raptor_stringbuffer_copy_to_string (raptor_stringbuffer *stringbuffer
,unsigned char *string
,size_t length
);
Copy the stringbuffer into a string.
Copies the underlying string to a pre-allocated buffer. The output string is always '\0' terminated.
int raptor_stringbuffer_write (raptor_stringbuffer *sb
,raptor_iostream *iostr
);
Write a stringbuffer to an iostream.