CLucene - a full-featured, c++ search engine
API Documentation


lucene::util::StringBuffer Class Reference

#include <StringBuffer.h>

Inheritance diagram for lucene::util::StringBuffer:
lucene::debug::LuceneBase

List of all members.

Public Member Functions

 StringBuffer ()
 Constructor. Allocates a buffer with the default length.
 StringBuffer (const int32_t initSize)
 Constructor. Allocates a buffer of length initSize + 1.
 StringBuffer (const TCHAR *value)
 Constructor.
 StringBuffer (TCHAR *buf, int32_t maxlen, const bool consumeBuffer)
 Constructs a StringBuffer using another buffer.
 ~StringBuffer ()
 Destructor.
void clear ()
 Clears the Stringbuffer and resets it to it default empty state.
void appendChar (const TCHAR chr)
 Appends a single character.
void append (const TCHAR *value)
 Appends a copy of the string value.
void append (const TCHAR *value, size_t appendedLength)
 Appends a copy of the string value.
void appendInt (const int32_t value)
 Appends an integer (after conversion to a character string).
void appendFloat (const float_t value, const int32_t digits)
 Appends a float_t (after conversion to a character string).
void prepend (const TCHAR *value)
 Puts a copy of the string value in front of the current string in the StringBuffer.
void prepend (const TCHAR *value, size_t prependedLength)
 Puts a copy of the string value in front of the current string in the StringBuffer.
int32_t length () const
 Returns the length of the string in the StringBuffer.
TCHAR * toString ()
 Returns a copy of the current string in the StringBuffer.
TCHAR * getBuffer ()
 Returns a null terminated reference to the StringBuffer's text.
void reserve (const int32_t length)
 reserve a minimum amount of data for the buffer.

Public Attributes

int32_t len
 Contains the length of string in the StringBuffer Public so that analyzers can edit the length directly.

Constructor & Destructor Documentation

lucene::util::StringBuffer::StringBuffer (  ) 

Constructor. Allocates a buffer with the default length.

lucene::util::StringBuffer::StringBuffer ( const int32_t  initSize  ) 

Constructor. Allocates a buffer of length initSize + 1.

lucene::util::StringBuffer::StringBuffer ( const TCHAR *  value  ) 

Constructor.

Creates an instance of Stringbuffer containing a copy of the string value

lucene::util::StringBuffer::StringBuffer ( TCHAR *  buf,
int32_t  maxlen,
const bool  consumeBuffer 
)

Constructs a StringBuffer using another buffer.

The StringBuffer can the be used to easily manipulate the buffer.

lucene::util::StringBuffer::~StringBuffer (  ) 

Destructor.


Member Function Documentation

void lucene::util::StringBuffer::append ( const TCHAR *  value,
size_t  appendedLength 
)

Appends a copy of the string value.

void lucene::util::StringBuffer::append ( const TCHAR *  value  ) 

Appends a copy of the string value.

void lucene::util::StringBuffer::appendChar ( const TCHAR  chr  ) 

Appends a single character.

void lucene::util::StringBuffer::appendFloat ( const float_t  value,
const int32_t  digits 
)

Appends a float_t (after conversion to a character string).

void lucene::util::StringBuffer::appendInt ( const int32_t  value  ) 

Appends an integer (after conversion to a character string).

void lucene::util::StringBuffer::clear (  ) 

Clears the Stringbuffer and resets it to it default empty state.

TCHAR* lucene::util::StringBuffer::getBuffer (  ) 

Returns a null terminated reference to the StringBuffer's text.

int32_t lucene::util::StringBuffer::length (  )  const

Returns the length of the string in the StringBuffer.

void lucene::util::StringBuffer::prepend ( const TCHAR *  value,
size_t  prependedLength 
)

Puts a copy of the string value in front of the current string in the StringBuffer.

void lucene::util::StringBuffer::prepend ( const TCHAR *  value  ) 

Puts a copy of the string value in front of the current string in the StringBuffer.

void lucene::util::StringBuffer::reserve ( const int32_t  length  ) 

reserve a minimum amount of data for the buffer.

no change made if the buffer is already longer than length

TCHAR* lucene::util::StringBuffer::toString (  ) 

Returns a copy of the current string in the StringBuffer.


Member Data Documentation

Contains the length of string in the StringBuffer Public so that analyzers can edit the length directly.


The documentation for this class was generated from the following file:

clucene.sourceforge.net