WSL/SLF GitLab Repository

Commit e1eee781 authored by Mathias Bavay's avatar Mathias Bavay
Browse files

CodeBlocks was not happy anymore with << for stringstream. Therefore we now use ostringstream.

parent 0a62da06
......@@ -383,7 +383,7 @@ template<class T> bool Array2D<T>::isEmpty() const {
}
template<class T> const std::string Array2D<T>::toString() const {
std::stringstream os;
std::ostringstream os;
os << "<array2d>\n";
for(unsigned int jj=0; jj<ny; jj++) {
const unsigned int jnx = jj*nx;
......
......@@ -442,7 +442,7 @@ template<class T> bool Array3D<T>::isEmpty() const {
}
template<class T> const std::string Array3D<T>::toString() const {
std::stringstream os;
std::ostringstream os;
os << "<array3d>\n";
for (unsigned int kk=0; kk<nz; kk++) {
os << "depth[" << kk << "]\n";
......
......@@ -378,7 +378,7 @@ void BufferedIOHandler::clearBuffer(){
const std::string BufferedIOHandler::toString() const
{
std::stringstream os;
std::ostringstream os;
os << "<BufferedIOHandler>\n";
os << "Config& cfg = " << hex << &cfg << dec << "\n";
os << "IOHandler &iohandler = " << hex << &iohandler << dec << "\n";
......
......@@ -82,7 +82,7 @@ bool Config::keyExists(const std::string& key, const std::string& section) const
}
const std::string Config::toString() const {
std::stringstream os;
std::ostringstream os;
os << "<Config>\n";
os << "Source: " << sourcename << "\n";
for (map<string,string>::const_iterator it = properties.begin(); it != properties.end(); ++it){
......@@ -207,7 +207,7 @@ void Config::parseLine(const unsigned int& linenr, std::vector<std::string> &imp
if(line[0] == '[') {
const size_t endpos = line.find_last_of(']');
if ((endpos == string::npos) || (endpos < 2) || (endpos != (line.length()-1))) {
stringstream tmp;
ostringstream tmp;
tmp << linenr;
throw IOException("Section header corrupt in line " + tmp.str(), AT);
} else {
......@@ -240,7 +240,7 @@ void Config::parseLine(const unsigned int& linenr, std::vector<std::string> &imp
properties[section+"::"+key] = value; //save the key/value pair
accept_import_before = false; //this is not an import, so no further import_before allowed
} else {
stringstream tmp;
ostringstream tmp;
tmp << linenr;
throw InvalidFormatException("Error reading key value pair in \"" + sourcename + "\" at line " + tmp.str(), AT);
}
......
......@@ -932,7 +932,7 @@ lat, double& lon)
* @return string containing the formatted coordinate
*/
std::string Coords::decimal_to_dms(const double& decimal) {
std::stringstream dms;
std::ostringstream dms;
const double abs_dec = fabs(decimal);
const int d = (int)floor(abs_dec);
const int m = (int)floor( (abs_dec - (double)d)*60. );
......@@ -1162,7 +1162,7 @@ int Coords::getUTMZone(const double i_latitude, const double i_longitude, std::s
else if((0 >= i_longitude) && (i_latitude <= -80)) zoneLetter = 'A';
else if((0 < i_longitude) && (i_latitude <= -80)) zoneLetter = 'B';
std::stringstream zone;
std::ostringstream zone;
zone << ZoneNumber << zoneLetter;
zone_out = zone.str();
......
......@@ -180,7 +180,7 @@ size_t DataGenerator::getArgumentsForAlgorithm(const Config& cfg,
}
const std::string DataGenerator::toString() const {
std::stringstream os;
std::ostringstream os;
os << "<DataGenerator>\n";
os << "Generators defined: " << generators_defined << "\n";
os << "User list of generators:\n";
......
......@@ -892,7 +892,7 @@ const string Date::toString(FORMATS type, const bool& gmt) const
}
const std::string Date::toString() const {
std::stringstream os;
std::ostringstream os;
os << "<date>\n";
if(undef==true)
os << "Date is undefined\n";
......
......@@ -312,7 +312,7 @@ double Grid2DObject::operator()(const unsigned int& i) const {
}
const std::string Grid2DObject::toString() const {
std::stringstream os;
std::ostringstream os;
os << "<Grid2DObject>\n";
os << llcorner.toString();
os << ncols << " x " << nrows << " @ " << cellsize << "m\n";
......
......@@ -324,7 +324,7 @@ double Grid3DObject::operator()(const unsigned int& i) const {
}
const std::string Grid3DObject::toString() const {
std::stringstream os;
std::ostringstream os;
os << "<Grid3DObject>\n";
os << llcorner.toString();
os << ncols << " x " << nrows << " x " << ndepths << " @ " << cellsize << "m\n";
......
......@@ -457,7 +457,7 @@ void IOManager::write2DGrid(const Grid2DObject& grid2D, const MeteoGrids::Parame
}
const std::string IOManager::toString() const {
stringstream os;
ostringstream os;
os << "<IOManager>\n";
os << "Config cfg = " << hex << &cfg << dec << "\n";
os << rawio.toString();
......
......@@ -118,7 +118,7 @@ size_t InterpolationAlgorithm::getStationAltitudes(const std::vector<StationData
*/
std::string InterpolationAlgorithm::getInfo() const
{
std::stringstream os;
std::ostringstream os;
os << algo << ", " << nrOfMeasurments;
if(nrOfMeasurments==1)
os << " station";
......
......@@ -162,7 +162,7 @@ class InterpolationAlgorithm {
std::vector<MeteoData> vecMeteo;
std::vector<double> vecData; ///<store the measurement for the given parameter
std::vector<StationData> vecMeta; ///<store the station data for the given parameter
std::stringstream info; ///<to store some extra information about the interoplation process
std::ostringstream info; ///<to store some extra information about the interoplation process
size_t nrOfMeasurments; ///<the available number of measurements
};
......
......@@ -132,7 +132,7 @@ Meteo1DInterpolator& Meteo1DInterpolator::operator=(const Meteo1DInterpolator& s
const std::string Meteo1DInterpolator::toString() const
{
stringstream os;
ostringstream os;
os << "<Meteo1DInterpolator>\n";
os << "Config& cfg = " << hex << &cfg << dec <<"\n";
os << "Resampling algorithms:\n";
......
......@@ -200,7 +200,7 @@ void Meteo2DInterpolator::checkMinMax(const double& minval, const double& maxval
}
const std::string Meteo2DInterpolator::toString() const {
stringstream os;
ostringstream os;
os << "<Meteo2DInterpolator>\n";
os << "Config& cfg = " << hex << &cfg << dec << "\n";
os << "IOManager& iomanager = " << hex << &iomanager << dec << "\n";
......
......@@ -278,7 +278,7 @@ size_t MeteoData::getParameterIndex(const std::string& parname) const
}
const std::string MeteoData::toString() const {
std::stringstream os;
std::ostringstream os;
os << "<meteo>\n";
os << meta.toString();
os << date.toString(Date::FULL) << "\n";
......
......@@ -107,7 +107,7 @@ bool MeteoProcessor::resample(const Date& date, const std::vector<MeteoData>& iv
}
const std::string MeteoProcessor::toString() const {
std::stringstream os;
std::ostringstream os;
os << "<MeteoProcessor>\n";
os << mi1d.toString();
os << "Processing stacks:\n";
......
......@@ -192,7 +192,7 @@ std::string ProcessingBlock::getName() const {
ProcessingBlock::~ProcessingBlock() {}
const std::string ProcessingBlock::toString() const {
std::stringstream os;
std::ostringstream os;
os << "[" << block_name << " ";
os << properties.toString();
os << "]";
......
......@@ -30,7 +30,7 @@ ProcessingStack::ProcessingStack(const Config& cfg, const std::string& parname)
string block_name = vec_filters[ii];
IOUtils::toUpper(block_name);
std::vector<std::string> vec_args;
std::stringstream tmp;
std::ostringstream tmp;
tmp << param_name << "::arg" << (ii+1);
getArgumentsForFilter(cfg, tmp.str(), vec_args); //Read arguments
......
......@@ -316,7 +316,7 @@ double SunObject::getSplitting(const double& iswr_measured) const
const std::string SunObject::toString() const
{
std::stringstream os;
std::ostringstream os;
const std::streamsize old_prec = os.precision();
os << "<SunObject>\n";
os << position.toString();
......
......@@ -463,7 +463,7 @@ void A3DIO::constructMeteo2DFilenames(const Date& startDate, const Date& endDate
cfg.getValue("METEOPATH", "Input", tmp);
for (int yyyy = startyear; yyyy<=endyear; yyyy++){
std::stringstream ss;
std::ostringstream ss;
ss << yyyy;
std::string precFilename = tmp + "/prec" + ss.str() + ".txt";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment