CLucene - a full-featured, c++ search engine
API Documentation
00001 /*------------------------------------------------------------------------------ 00002 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team 00003 * 00004 * Distributable under the terms of either the Apache License (Version 2.0) or 00005 * the GNU Lesser General Public License, as specified in the COPYING file. 00006 ------------------------------------------------------------------------------*/ 00007 #ifndef _lucene_util_StringBuffer_ 00008 #define _lucene_util_StringBuffer_ 00009 00010 #if defined(_LUCENE_PRAGMA_ONCE) 00011 # pragma once 00012 #endif 00013 00014 00015 CL_NS_DEF(util) 00016 class StringBuffer:LUCENE_BASE{ 00017 public: 00019 StringBuffer(); 00021 StringBuffer(const int32_t initSize); 00024 StringBuffer(const TCHAR* value); 00027 StringBuffer(TCHAR* buf,int32_t maxlen, const bool consumeBuffer); 00029 ~StringBuffer(); 00031 void clear(); 00032 00034 void appendChar(const TCHAR chr); 00036 void append(const TCHAR* value); 00038 void append(const TCHAR* value, size_t appendedLength); 00040 void appendInt(const int32_t value); 00042 void appendFloat(const float_t value, const int32_t digits); 00044 void prepend(const TCHAR* value); 00046 void prepend(const TCHAR* value, size_t prependedLength); 00047 00050 int32_t len; 00052 int32_t length() const; 00054 TCHAR* toString(); 00056 TCHAR* getBuffer(); 00057 00058 00061 void reserve(const int32_t length); 00062 private: 00064 TCHAR* buffer; 00066 int32_t bufferLength; 00067 bool bufferOwner; 00068 00070 void growBuffer(const int32_t minLength); 00073 void growBuffer(const int32_t minLength, const int32_t skippingNInitialChars); 00074 00075 }; 00076 CL_NS_END 00077 #endif