00001
00009 #ifndef STSSTREAM_H
00010 #define STSSTREAM_H
00011 #include <ctype.h>
00012 #include "Rstrstream.h"
00013 #ifdef R__SSTREAM
00014 using std::streamsize;
00015 class ostrstream : public std::ostringstream {
00016 std::string myString;
00017 public:
00018 const char *str()
00019 {
00020 std::string tmp = std::ostringstream::str();
00021 if (myString != tmp) myString=tmp;
00022 return myString.c_str();
00023 }
00024 int pcount() {return int(tellp()) ;}
00025 void seekp(int pos) {if (int(tellp())>=0) std::ostringstream::seekp(pos);}
00026 void freeze(bool) const{;}
00027 };
00028
00029
00030 class istrstream : public std::istringstream {
00031 public:
00032 istrstream(): std::istringstream(){}
00033 istrstream(const char *init):std::istringstream(std::string(init)){}
00034 };
00035 #else
00036 #endif
00037
00038 #endif