#include "String++.h"
#include <string.h>
#include <ctype.h>
-#include "concat.h"
#include "io_stream.h"
#include <iostream>
-#include <strstream>
+#include <sstream>
#include <string>
+using namespace std;
+
// _data
String::_data::_data(_data const &aData) : count (1), theString (new unsigned char[aData.length]), cstr(0), length (aData.length) {
String::String (int const anInt)
{
- ostrstream os;
+ ostringstream os;
os << anInt;
- theData = new _data(os.pcount());
- memcpy (theData->theString, os.str(), os.pcount());
+ theData = new _data(os.str().size());
+ memcpy (theData->theString, os.str().c_str(), os.str().size());
}
String::String (string const &aString) : theData (new _data (aString.c_str() ? strlen (aString.c_str()) : 0))