00001 /* 00002 * $Id: BufferedTextInputStream.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_BUFFERED_TEXT_INPUT_STREAM_H__ 00015 #define __XVR2_BUFFERED_TEXT_INPUT_STREAM_H__ 00016 #include<xvr2/String.h> 00017 #include<xvr2/StreamInterface.h> 00018 #include<xvr2/RawInputStream.h> 00019 00020 namespace xvr2 { 00021 00023 class BufferedTextInputStream : public RawInputStream { 00024 protected: 00025 UInt32 _bufsize; 00026 String buffer; 00027 String _lterm; 00028 public: 00029 BufferedTextInputStream(); 00030 BufferedTextInputStream(RawInputStream &input, const String &__lterm = NL); 00031 void open(RawInputStream &input, const String &__lterm = NL); 00032 ~BufferedTextInputStream(); 00033 //virtual UInt32 read(void *data, UInt32 size); 00034 void operator>>(String &s); 00035 static void setDefaultBufferSize(UInt32 _size); 00036 void setBufferSize(UInt32 _size); 00038 UInt32 remaining(); 00039 }; 00040 } 00041 00042 #endif 00043