[ROOT] string streams

From: Justin Findlay (findlay@cosmic.utah.edu)
Date: Fri May 30 2003 - 02:57:07 MEST


Hi,

I would like to know how one can use stringstream objects.  If I do this,


{
#include <string>
#include <sstream>

using namespace std;

int    i = 1;
double d = 1.1;
string s = "asdf";
ostringstream osstr;

osstr << i << " " << d << " " << s << endl;
}


then I get


Error: operator<< not defined for basic_ostream<char,char_traits<char> > FILE:sstream.cpp LINE:12


Of course, this is just a CINT limitation, but it would be very useful to
create a TSstream class which can concatinate and extract ROOT strings
like C++ strings.  It seems the only way one can use sstream functionality
now is by stringing characters into a C++ string and converting it into a
ROOT TString or TCut object at the last step (assuming the code has been
compiled and correctly linked against sstream).  As it is now I am using
sprintf() with its obvious static limitations.


Justin



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET