Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

StringBufferFormatter Class Reference
[Utils - String formatting]

#include <stringf.h>

Inheritance diagram for StringBufferFormatter:

StringFormatter List of all members.

Detailed Description

A StringFormatter which stores text in a specified buffer.

Important note: the produced string will only have a terminating null character if the produced text has a size less than the size of the buffer.

Definition at line 351 of file stringf.h.

Public Member Functions

 StringBufferFormatter (char *buffer, size_t size)
virtual void Out (const char *text, size_t textSize)
virtual void Out (char character, size_t repeatCount)
char * End ()

Protected Attributes

char * BufferStart
 Start of buffer used to store text.
char * BufferEnd
 End of buffer used to store text. (The address immediately after the last byte.).
char * BufferPtr
 Address to store the next byte of text to be 'output'.


Constructor & Destructor Documentation

StringBufferFormatter::StringBufferFormatter char *  buffer,
size_t  size
 

Parameters:
buffer Address of the buffer to store text in.
size Size of buffer.

Definition at line 631 of file stringf.cpp.


Member Function Documentation

void StringBufferFormatter::Out const char *  text,
size_t  textSize
[virtual]
 

Called to 'output' generated text.

Parameters:
text Pointer to text.
textSize Size of text.

Implements StringFormatter.

Definition at line 642 of file stringf.cpp.

void StringBufferFormatter::Out char  character,
size_t  repeatCount
[virtual]
 

Called to 'output' a repeated single character.

Parameters:
character The character to output.
repeatCount Number of times character should be output.

Implements StringFormatter.

Definition at line 654 of file stringf.cpp.

char * StringBufferFormatter::End  ) 
 

Terminate text generation.

This appends a null character after the end of the generated text (if there is space in the buffer) and sets the buffer state to be empty.

Returns:
End of generated text. This is the address of the terminating null character, or the address immediately after the end of the buffer if the buffer was full.

Definition at line 666 of file stringf.cpp.


The documentation for this class was generated from the following files:
Generated by  doxygen 1.4.4