1 /*! 2 * \file Stsstream.h 3 * 4 * \author Victor Perev 8/22/2003 5 * Wrapper for old <strstream> 6 * 7 * 8 */ 9 #ifndef STSSTREAM_H 10 #define STSSTREAM_H 11 #include <ctype.h> 12 #include "Rstrstream.h" 13 #ifdef R__SSTREAM 14 using std::streamsize; 15 class ostrstream : public std::ostringstream { 16 std::string myString; 17 public: 18 const char *str() 19 { 20 std::string tmp = std::ostringstream::str(); 21 if (myString != tmp) myString=tmp; 22 return myString.c_str(); 23 } 24 int pcount() {return int(tellp()) ;} 25 void seekp(int pos) {if (int(tellp())>=0) std::ostringstream::seekp(pos);} 26 void freeze(bool) const{;} 27 }; 28 29 30 class istrstream : public std::istringstream { 31 public: 32 istrstream(): std::istringstream(){} 33 istrstream(const char *init):std::istringstream(std::string(init)){} 34 }; 35 #else 36 #endif 37 38 #endif 39