00001 /* 00002 * $Id: BasicStringBuffer.h 562 2007-12-02 08:04:16Z mindstorm2600 $ 00003 * 00004 * X-VR2 00005 * 00006 * Copyright (C) Juan V. Guerrero 2007 00007 * 00008 * Juan V. Guerrero <mindstorm2600@users.sourceforge.net> 00009 * 00010 * This program is free software, distributed under the terms of 00011 * the GNU General Public License Version 2. See the LICENSE file 00012 * at the top of the source tree. 00013 */ 00014 #ifndef __XVR2_BASIC_STRING_BUFFER_H__ 00015 #define __XVR2_BASIC_STRING_BUFFER_H__ 00016 #ifndef __XVR2_ENABLE_BASIC_STRING_BUFFER__ 00017 #error "DO NOT INCLUDE THIS FILE DIRECTLY" 00018 #endif 00019 #include<xvr2/Object.h> 00020 namespace xvr2 { 00021 template<class StringT> 00022 class BasicStringBuffer:public Object { 00023 public: 00024 typedef BasicStringBuffer<StringT> MySBType; 00025 protected: 00026 StringT buffer; 00027 public: 00028 00029 BasicStringBuffer(){ 00030 } 00031 ~BasicStringBuffer(){ 00032 } 00033 BasicStringBuffer(const StringT &s){ 00034 buffer = s; 00035 } 00036 void clear(){ 00037 buffer.clear(); 00038 } 00039 virtual MySBType &operator<<(const StringT &s) { 00040 buffer.append(s); 00041 return *this; 00042 } 00043 }; 00044 } 00045 00046 #endif