WSL/SLF GitLab Repository

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

Fixing some warnings for Visual C++ and also using ostringstream instead of...

Fixing some warnings for Visual C++ and also using ostringstream instead of stringstream when appropriate
parent afd4635c
......@@ -277,7 +277,7 @@ void BufferedIOHandler::readMeteoData(const Date& date_start, const Date& date_e
iohandler.readMeteoData(new_buffer_end, new_buffer_end+chunk_size, tmp_meteo_buffer);
if (tmp_meteo_buffer.size() != buffer_size) {
stringstream ss;
ostringstream ss;
ss << "The number of stations changed over time from " << buffer_size << " to " << tmp_meteo_buffer.size() << ", ";
ss << "this is not handled yet!";
throw IOException(ss.str(), AT);
......@@ -367,8 +367,8 @@ void BufferedIOHandler::write2DGrid(const Grid2DObject& grid_in, const MeteoGrid
void BufferedIOHandler::clearBuffer() {
IndexBufferedGrids.clear();
vec_buffer_meteo.clear();
buffer_start = 0.;
buffer_end = 0.;
buffer_start = Date(0., 0.);
buffer_end = Date(0., 0.);
mapBufferedGrids.clear();
}
......
......@@ -196,7 +196,7 @@ class Config {
try {
IOUtils::getValueForKey<T>(properties, new_section + "::" + new_key, vecT, opt);
} catch(const std::exception& e){
} catch(const std::exception&){
throw UnknownValueException("[E] Error in "+sourcename+": no value for key "+new_section+"::"+new_key, AT);
}
}
......@@ -251,7 +251,7 @@ class Config {
try {
IOUtils::getValueForKey<T>(properties, new_section + "::" + new_key, t, opt);
} catch(const std::exception& e){
} catch(const std::exception&){
throw UnknownValueException("[E] Error in "+sourcename+": no value for key "+new_section+"::"+new_key, AT);
}
}
......@@ -268,7 +268,7 @@ class Config {
T tmp;
try {
IOUtils::getValueForKey<T>(properties, full_key, tmp, IOUtils::dothrow);
} catch(const std::exception& e){
} catch(const std::exception&){
throw UnknownValueException("[E] Error in "+sourcename+" reading key "+full_key, AT);
}
vecT.push_back(tmp);
......
......@@ -223,7 +223,7 @@ void Coords::merge(const Coords& coord2) {
* The Coords is bound by "<Coords>" and "</Coords>" on separate lines
*/
const std::string Coords::toString() const {
std::stringstream os;
std::ostringstream os;
os << "<Coords>\n";
os << "Altitude\t" << altitude << "\n";
os << "Lat/Long\t" << printLatLon() << "\n";
......@@ -410,7 +410,7 @@ int Coords::getGridK() const {
void Coords::getProj(std::string& proj_type, std::string& proj_args) const {
proj_type = coordsystem;
if(coordsystem=="LOCAL") {
std::stringstream dms;
std::ostringstream dms;
dms << "(" << decimal_to_dms(ref_latitude) << " , " << decimal_to_dms(ref_longitude) << ")";
proj_args=dms.str();
} else {
......@@ -423,7 +423,7 @@ void Coords::getProj(std::string& proj_type, std::string& proj_args) const {
* @return lat/lon
*/
std::string Coords::printLatLon() const {
std::stringstream dms;
std::ostringstream dms;
dms << "(" << decimal_to_dms(latitude) << " , " << decimal_to_dms(longitude) << ")";
return dms.str();
......@@ -735,7 +735,7 @@ short int Coords::getEPSG() const {
if(coordsystem=="PROJ4") {
const int tmp = atoi(coordparam.c_str());
if(tmp<0 || tmp>32767) {
std::stringstream ss;
std::ostringstream ss;
ss << "Invalid EPSG code argument: " << tmp << ". It should be between 0 and 32767! (please check EPSG registry)";
throw InvalidArgumentException(ss.str(), AT);
}
......@@ -756,7 +756,7 @@ void Coords::setEPSG(const int epsg) {
std::string coord_sys, coord_param;
if(epsg<0 || epsg>32767) {
std::stringstream ss;
std::ostringstream ss;
ss << "Invalid epsg code " << epsg << " (it should be between 0 and 32767)!";
throw InvalidArgumentException(ss.str(), AT);
}
......
......@@ -575,7 +575,7 @@ void DEMObject::getPointsBetween(const Coords& point, const double& bearing, std
}
if(gridify(pointlim)==false) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "[E] Wrong destination point calculated for bearing " << bearing;
throw InvalidArgumentException(tmp.str(), AT);
}
......
......@@ -553,8 +553,6 @@ double Date::rnd(const double& julian, const unsigned int& precision, const RND&
return integral + (double)Optim::floor( fractional*rnd_factor ) / rnd_factor + .5;
throw UnknownValueException("Unknown rounding strategy!", AT);
return julian;
}
/**
......@@ -833,7 +831,7 @@ const string Date::toString(FORMATS type, const bool& gmt) const
calculateValues(julian_out, year_out, month_out, day_out, hour_out, minute_out);
}
stringstream tmpstr;
ostringstream tmpstr;
switch(type) {
case(ISO_TZ):
case(ISO):
......@@ -1012,14 +1010,14 @@ void Date::plausibilityCheck(const int& in_year, const int& in_month, const int&
|| ((in_day > daysLeapYear[in_month-1]) && isLeapYear(in_year))
|| (in_hour < 0) || (in_hour > 24)
|| (in_minute < 0) || (in_minute > 59)) {
stringstream ss;
ostringstream ss;
ss << "Invalid Date requested: " << in_year << "-" << in_month;
ss << "-" << in_day << "T" << in_hour << ":" << in_minute;
throw IOException(ss.str(), AT);
}
if ((in_hour == 24) && (in_minute != 0)) {
stringstream ss;
ostringstream ss;
ss << "Invalid Date requested: " << in_year << "-" << in_month;
ss << "-" << in_day << "T" << in_hour << ":" << in_minute;
throw IOException(ss.str(), AT);
......
......@@ -18,6 +18,7 @@
#include <meteoio/GeneratorAlgorithms.h>
#include <meteoio/MathOptim.h>
#include <meteoio/meteolaws/Atmosphere.h>
#include <meteoio/meteolaws/Meteoconst.h>
using namespace std;
......@@ -111,12 +112,12 @@ bool SinGenerator::generate(const size_t& param, MeteoData& md)
const double julian = md.date.getJulian();
t = (julian - Optim::intPart(julian) - phase) + .25; //watch out: julian day starts at noon!
} else {
std::stringstream ss;
std::ostringstream ss;
ss << "Invalid period \"" << type << "\" specified for the " << algo << " generator";
throw InvalidArgumentException(ss.str(), AT);
}
const double w = 2.*M_PI;
const double w = 2.*Cst::PI;
value = amplitude * sin(w*t) + offset;
}
......
......@@ -25,6 +25,10 @@
#include <set>
#include <string>
#ifdef WIN32
#pragma warning(disable:4512) //we don't need any = operator!
#endif
namespace mio {
/**
......
......@@ -154,7 +154,7 @@ unsigned int legend::getLegendWidth() {
void legend::writeLine(const double& val, const unsigned int& px_row)
{
std::stringstream ss;
std::ostringstream ss;
//const unsigned int precision = text_chars_nb-6; //full width - (sgn, dot, "e", sgn, two digits exponent)
//ss << std::setfill (' ') << std::setw(text_chars_nb) << std::left << std::setprecision(precision) << val; //improve this format...
ss << std::setfill (' ') << std::setw(text_chars_nb) << std::left << val;
......@@ -175,7 +175,7 @@ void legend::writeLine(const double& val, const unsigned int& px_row)
}
for(size_t i=0; i<ss.str().size(); i++) {
char c=ss.str()[i];
const char c=ss.str()[i];
const unsigned int px_col = (unsigned int)i*(char_width+char_space)+x_offset;
if(c=='0') writeChar(font_0, px_col, px_row);
if(c=='1') writeChar(font_1, px_col, px_row);
......@@ -345,7 +345,7 @@ void Gradient::setModel(const Type& i_type)
void Gradient::setNrOfLevels(const unsigned char& i_nr_unique_levels) {
if(i_nr_unique_levels<=reserved_idx) {
stringstream ss;
ostringstream ss;
ss << "Insufficient number of colors requested for gradient: ask for more than ";
ss << reserved_idx << " colors!";
throw InvalidArgumentException(ss.str(), AT);
......@@ -414,7 +414,7 @@ void Gradient::getColor(const double& val, unsigned char& index) const
if(delta==0) { //otherwise constant data throughout the grid makes a division by zero...
#ifndef NOSAFECHECKS
if((nr_unique_cols/2 + reserved_idx) > std::numeric_limits<unsigned char>::max()) {
std::stringstream ss;
std::ostringstream ss;
ss << "[E] Number of unique colors in gradient and/or reserved index too large to fit in index: ";
ss << (nr_unique_cols/2 + reserved_idx) << " when it should be at most " << std::numeric_limits<unsigned char>::max();
throw IndexOutOfBoundsException(ss.str(), AT);
......@@ -477,7 +477,7 @@ void Gradient::getPalette(std::vector<unsigned char> &palette, size_t &nr_colors
const size_t nr_entries = palette.size();
if((nr_entries%3) != 0) {
std::stringstream ss;
std::ostringstream ss;
ss << "Error when creating color palette: " << nr_entries << " data points ";
ss << "for 3 channels palette is impossible! (colors are interlaced)";
throw IOException(ss.str(), AT);
......@@ -491,7 +491,7 @@ double Gradient_model::getInterpol(const double& val, const std::vector<double>&
const size_t nr = i_X.size();
#ifndef NOSAFECHECKS
if(i_Y.size()!=nr) {
std::stringstream ss;
std::ostringstream ss;
ss << "For color gradients interpolations, both X and Y vectors must have the same size! ";
ss << "There are " << i_X.size() << " abscissa for " << i_Y.size() << " ordinates.";
throw IOException(ss.str(), AT);
......
......@@ -198,7 +198,7 @@ void Grid2DObject::set(const size_t& i_ncols, const size_t& i_nrows,
{
//Test for equality in size: Only compatible Array2D<double> grids are permitted
if ((i_ncols != i_grid2D.getNx()) || (i_nrows != i_grid2D.getNy())) {
std::stringstream ss;
std::ostringstream ss;
ss << "Trying to initialize a ( " << i_ncols << " x " << i_nrows << " ) Grid2DObject with a ";
ss << "( " << i_grid2D.getNx() << " x " << i_grid2D.getNy() << " ) 2D array";
throw IOException(ss.str(), AT);
......
......@@ -233,7 +233,7 @@ void Grid3DObject::set(const size_t& i_ncols, const size_t& i_nrows, const size_
{
//Test for equality in size: Only compatible Array3D<double> grids are permitted
if ((i_ncols != i_grid3D.getNx()) || (i_nrows != i_grid3D.getNy()) || (i_ndepths != i_grid3D.getNz())) {
std::stringstream ss;
std::ostringstream ss;
ss << "Trying to initialize a ( " << i_ncols << " x " << i_nrows << " x " << i_ndepths << " ) Grid3DObject with a ";
ss << "( " << i_grid3D.getNx() << " x " << i_grid3D.getNy() << " x " << i_grid3D.getNz() << " ) 3D array";
throw IOException(ss.str(), AT);
......
......@@ -86,7 +86,7 @@ IOException::IOException(const std::string& message, const std::string& position
std::string backtrace_info = "\n\033[01;30m**** backtrace ****\n"; //we use ASCII color codes to make the backtrace less visible/aggressive
for (unsigned int ii=1; ii<(unsigned)tracesize; ii++) {
#ifdef __GNUC__
std::stringstream ss;
std::ostringstream ss;
char *mangled_name = 0, *offset_begin = 0, *offset_end = 0;
for (char *p = symbols[ii]; *p; ++p) {
// find parantheses and +address offset surrounding mangled name
......
......@@ -407,7 +407,7 @@ void IOHandler::copy_parameters(const size_t& stationindex, std::vector< METEO_S
for (size_t kk=0; kk<nr_of_params; ++kk) {
const size_t param_index = vecMeteo[ii][jj].getParameterIndex(copy_parameter[kk]);
if (param_index == IOUtils::npos) {
std::stringstream ss;
std::ostringstream ss;
ss << "At " << vecMeteo[ii][jj].date.toString(Date::ISO) << ", station " << vecMeteo[ii][jj].meta.stationID;
ss << " has no parameter \"" << copy_parameter[kk] << "\" to copy!\n";
throw InvalidArgumentException(ss.str(), AT);
......@@ -433,7 +433,7 @@ const std::string IOHandler::toString()
const std::string IOHandler::toString() const
#endif
{
std::stringstream os;
std::ostringstream os;
os << "<IOHandler>\n";
os << "Config& cfg = " << hex << &cfg << dec << "\n";
......
......@@ -67,7 +67,7 @@ void IOManager::push_meteo_data(const ProcessingLevel& level, const Date& date_s
{
//perform check on date_start and date_end
if (date_end < date_start) {
std::stringstream ss;
std::ostringstream ss;
ss << "Trying to push data set from " << date_start.toString(Date::ISO) << " to " << date_end.toString(Date::ISO) << ". ";
ss << " Obviously, date_start should be less than date_end!";
throw InvalidArgumentException(ss.str(), AT);
......
......@@ -34,7 +34,7 @@ IOPlugin& IOPlugin::operator=(const IOPlugin& source)
}
const std::string IOPlugin::toString() const {
std::stringstream os;
std::ostringstream os;
const int pt_w=8;
os << "<IOPlugin>" << std::setw(10) << classname;
os << "," << std::showbase << std::setw(pt_w+2) << io;
......
......@@ -55,7 +55,7 @@ double round(const double& x) {
#endif
std::string getLibVersion() {
std::stringstream ss;
std::ostringstream ss;
ss << _VERSION << " compiled on " << __DATE__ << " " << __TIME__;
return ss.str();
}
......@@ -396,7 +396,7 @@ void readKeyValueHeader(std::map<std::string,std::string>& headermap,
if(result) {
headermap[key] = value;
} else { // means if ((key == "") || (value==""))
std::stringstream out;
std::ostringstream out;
out << "Invalid key value pair in line: " << linenr << " of header";
throw IOException(out.str(), AT);
}
......@@ -461,7 +461,7 @@ size_t readLineToVec(const std::string& line_in, std::vector<double>& vec_data)
iss >> std::skipws >> tmp;
if (iss.fail()) {
std::stringstream ss;
std::ostringstream ss;
ss << "Can not read column " << vec_data.size()+1 << " in data line \"" << line_in << "\"";
throw InvalidFormatException(ss.str(), AT);
}
......@@ -779,7 +779,7 @@ std::string printFractionalDay(const double& fractional) {
const double minutes=floor((fractional*24.-hours)*60.);
const double seconds=fractional*24.*3600.-hours*3600.-minutes*60.;
std::stringstream tmp;
std::ostringstream tmp;
tmp << std::fixed << std::setfill('0') << std::setprecision(0);
tmp << std::setw(2) << hours << ":";
tmp << std::setw(2) << minutes << ":";
......@@ -791,7 +791,7 @@ std::string printFractionalDay(const double& fractional) {
void getArraySliceParams(const size_t& dimx, const unsigned int& nbworkers, const unsigned int &wk, size_t& startx, size_t& nx)
{
if(nbworkers>dimx) {
std::stringstream ss;
std::ostringstream ss;
ss << "Can not split " << dimx << " columns in " << nbworkers << " bands!";
throw InvalidArgumentException(ss.str(), AT);
}
......@@ -874,7 +874,7 @@ size_t FileIndexer::binarySearch(const Date& soughtdate) const
const std::string FileIndexer::toString() const
{
std::stringstream os;
std::ostringstream os;
os << "<FileIndexer>\n";
for(size_t ii=0; ii<vecIndex.size(); ii++)
os << "\t" << "[" << ii << "] - " << vecIndex[ii].date.toString(Date::ISO) << " -> #" << std::hex << vecIndex[ii].pos << std::dec << "\n";
......
......@@ -27,7 +27,7 @@ const double Matrix::epsilon_mtr = 1e-6; //for comparing two matrix
Matrix::Matrix(const int& rows, const int& cols) : vecData(), ncols(0), nrows(0) {
if(rows<0 || cols<0) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying construct a matrix with negative dimensions: ";
tmp << "(" << rows << "," << cols << ")";
throw IOException(tmp.str(), AT);
......@@ -78,7 +78,7 @@ void Matrix::random(const double& range) {
double& Matrix::operator ()(const size_t& i, const size_t& j) {
#ifndef NOSAFECHECKS
if ((i<1) || (i > nrows) || (j<1) || (j > ncols)) {
std::stringstream ss;
std::ostringstream ss;
ss << "Trying to access matrix[" << i << "," << j << "]";
throw IndexOutOfBoundsException(ss.str(), AT);
}
......@@ -89,7 +89,7 @@ double& Matrix::operator ()(const size_t& i, const size_t& j) {
double Matrix::operator ()(const size_t& i, const size_t& j) const {
#ifndef NOSAFECHECKS
if ((i<1) || (i > nrows) || (j<1) || (j > ncols)) {
std::stringstream ss;
std::ostringstream ss;
ss << "Trying to access matrix[" << i << "," << j << "]";
throw IndexOutOfBoundsException(ss.str(), AT);
}
......@@ -98,7 +98,7 @@ double Matrix::operator ()(const size_t& i, const size_t& j) const {
}
const std::string Matrix::toString() const {
std::stringstream os;
std::ostringstream os;
const size_t wd=6;
os << "\n┌ ";
for(size_t jj=1; jj<=(ncols*(wd+1)); jj++)
......@@ -138,7 +138,7 @@ bool Matrix::operator!=(const Matrix& in) const {
Matrix& Matrix::operator+=(const Matrix& rhs) {
//check dimensions compatibility
if(nrows!=rhs.nrows || ncols!=rhs.ncols) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to add two matrix with incompatible dimensions: ";
tmp << "(" << nrows << "," << ncols << ") * ";
tmp << "(" << rhs.nrows << "," << rhs.ncols << ")";
......@@ -177,7 +177,7 @@ const Matrix Matrix::operator+(const double& rhs) const {
Matrix& Matrix::operator-=(const Matrix& rhs) {
//check dimensions compatibility
if(nrows!=rhs.nrows || ncols!=rhs.ncols) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to substract two matrix with incompatible dimensions: ";
tmp << "(" << nrows << "," << ncols << ") * ";
tmp << "(" << rhs.nrows << "," << rhs.ncols << ")";
......@@ -214,7 +214,7 @@ const Matrix Matrix::operator-(const double& rhs) const {
Matrix& Matrix::operator*=(const Matrix& rhs) {
//check dimensions compatibility
if(ncols!=rhs.nrows) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to multiply two matrix with incompatible dimensions: ";
tmp << "(" << nrows << "," << ncols << ") * ";
tmp << "(" << rhs.nrows << "," << rhs.ncols << ")";
......@@ -278,7 +278,7 @@ double Matrix::scalar(const Matrix& m) {
double Matrix::scalar() const {
if(ncols!=1 || nrows!=1) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to get scalar value of a non (1x1) matrix ";
tmp << "(" << nrows << "," << ncols << ") !";
throw IOException(tmp.str(), AT);
......@@ -292,14 +292,14 @@ double Matrix::dot(const Matrix& A, const Matrix& B) {
B.size(Brows, Bcols);
if(Acols!=1 || Bcols!=1) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to get dot product of non vector matrix ";
tmp << "(" << Arows << "," << Acols << ") · ";
tmp << "(" << Brows << "," << Bcols << ") · ";
throw IOException(tmp.str(), AT);
}
if(Arows!=Brows) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to get dot product of incompatible matrix ";
tmp << "(" << Arows << "," << Acols << ") · ";
tmp << "(" << Brows << "," << Bcols << ") · ";
......@@ -335,7 +335,7 @@ void Matrix::T() {
double Matrix::det() const {
if(nrows!=ncols) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to calculate the determinant of a non-square matrix ";
tmp << "(" << nrows << "," << ncols << ") !";
throw IOException(tmp.str(), AT);
......@@ -353,7 +353,7 @@ bool Matrix::LU(Matrix& L, Matrix& U) const {
//Dolittle algorithm, cf http://math.fullerton.edu/mathews/numerical/linear/dol/dol.html
//HACK: there is no permutation matrix, so it might not be able to give a decomposition...
if(nrows!=ncols) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to calculate the LU decomposition of a non-square matrix ";
tmp << "(" << nrows << "," << ncols << ") !";
throw IOException(tmp.str(), AT);
......@@ -391,7 +391,7 @@ Matrix Matrix::getInv() const {
//This uses an LU decomposition followed by backward and forward solving for the inverse
//See for example Press, William H.; Flannery, Brian P.; Teukolsky, Saul A.; Vetterling, William T. (1992), "LU Decomposition and Its Applications", Numerical Recipes in FORTRAN: The Art of Scientific Computing (2nd ed.), Cambridge University Press, pp. 34–42
if(nrows!=ncols) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to invert a non-square matrix ";
tmp << "(" << nrows << "," << ncols << ") !";
throw IOException(tmp.str(), AT);
......@@ -445,7 +445,7 @@ Matrix Matrix::getInv() const {
bool Matrix::inv() {
//same as getInv() const but we write the final result on top of the input matrix
if(nrows!=ncols) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to invert a non-square matrix ";
tmp << "(" << nrows << "," << ncols << ") !";
throw IOException(tmp.str(), AT);
......@@ -501,14 +501,14 @@ bool Matrix::solve(const Matrix& A, const Matrix& B, Matrix& X) {
size_t Anrows,Ancols, Bnrows, Bncols;
A.size(Anrows, Ancols);
if(Anrows!=Ancols) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to solve A·X=B with A non square matrix ";
tmp << "(" << Anrows << "," << Ancols << ") !";
throw IOException(tmp.str(), AT);
}
B.size(Bnrows, Bncols);
if(Anrows!=Bnrows) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to solve A·X=B with A and B of incompatible dimensions ";
tmp << "(" << Anrows << "," << Ancols << ") and (";
tmp << "(" << Bnrows << "," << Bncols << ") !";
......@@ -571,21 +571,21 @@ bool Matrix::TDMA_solve(const Matrix& A, const Matrix& B, Matrix& X)
size_t Anrows,Ancols, Bnrows, Bncols;
A.size(Anrows, Ancols);
if(Anrows!=Ancols) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to solve A·X=B with A non square matrix ";
tmp << "(" << Anrows << "," << Ancols << ") !";
throw IOException(tmp.str(), AT);
}
B.size(Bnrows, Bncols);
if(Anrows!=Bnrows) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to solve A·X=B with A and B of incompatible dimensions ";
tmp << "(" << Anrows << "," << Ancols << ") and (";
tmp << "(" << Bnrows << "," << Bncols << ") !";
throw IOException(tmp.str(), AT);
}
if(Bncols!=1) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Trying to solve A·X=B but B is not a vector! It is ";
tmp << "(" << Bnrows << "," << Bncols << ") !";
throw IOException(tmp.str(), AT);
......@@ -627,7 +627,7 @@ Matrix Matrix::TDMA_solve(const Matrix& A, const Matrix& B) {
bool Matrix::isIdentity() const {
if(nrows!=ncols) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "A non-square matrix ";
tmp << "(" << nrows << "," << ncols << ") can not be the identity matrix!";
throw IOException(tmp.str(), AT);
......
......@@ -214,7 +214,7 @@ void Meteo2DInterpolator::check_projections(const DEMObject& dem, const std::vec
for (size_t ii=0; ii<vec_meteo.size(); ii++) {
const StationData& meta = vec_meteo[ii].meta;
if(!meta.position.isSameProj(dem.llcorner)) {
std::stringstream os;
std::ostringstream os;
std::string type, args;
meta.position.getProj(type, args);
os << "Station " << meta.stationID << " is using projection (" << type << " " << args << ") ";
......
......@@ -377,7 +377,7 @@ void MeteoData::merge(const MeteoData& meteo2)
{
if( !date.isUndef() && !meteo2.date.isUndef() && date!=meteo2.date) {
//the data must be time synchronized!
std::stringstream ss;
std::ostringstream ss;
ss << "Trying to merge MeteoData at " << date.toString(Date::ISO);
ss << " with MeteoData at " << meteo2.date.toString(Date::ISO);
throw InvalidArgumentException(ss.str(), AT);
......
......@@ -141,7 +141,7 @@ NoResampling::NoResampling(const std::string& i_algoname, const std::string& i_p
std::string NoResampling::toString() const
{
stringstream ss;
ostringstream ss;
ss << right << setw(10) << parname << "::" << left << setw(15) << algo;
ss << "[ ]";
return ss.str();
......@@ -189,7 +189,7 @@ NearestNeighbour::NearestNeighbour(const std::string& i_algoname, const std::str
std::string NearestNeighbour::toString() const
{
stringstream ss;
ostringstream ss;
ss << right << setw(10) << parname << "::" << left << setw(15) << algo;
ss << "[ window_size=" << window_size << " extrapolate=" << extrapolate << " ]";
return ss.str();
......@@ -270,7 +270,7 @@ LinearResampling::LinearResampling(const std::string& i_algoname, const std::str
std::string LinearResampling::toString() const
{
stringstream ss;
ostringstream ss;
ss << right << setw(10) << parname << "::" << left << setw(15) << algo;
ss << "[ window_size=" << window_size << " extrapolate=" << extrapolate << " ]";
return ss.str();
......@@ -346,7 +346,7 @@ Accumulate::Accumulate(const std::string& i_algoname, const std::string& i_parna
IOUtils::convertString(accumulate_period, vecArgs[0]);
accumulate_period /= 86400.; //user uses seconds, internally julian day is used
if(accumulate_period<=0.) {
std::stringstream tmp;
std::ostringstream tmp;
tmp << "Invalid accumulation period (" << accumulate_period << ") for \"" << i_parname << "::" << i_algoname << "\"";
throw InvalidArgumentException(tmp.str(), AT);
}
......@@ -363,7 +363,7 @@ Accumulate::Accumulate(const std::string& i_algoname, const std::string& i_parna
std::string Accumulate::toString() const
{
stringstream ss;
ostringstream ss;
ss << right << setw(10) << parname << "::" << left << setw(15) << algo;
ss << "[ accumulate_period=" << accumulate_period << " strict=" << strict << " ]";
return ss.str();
......@@ -449,7 +449,7 @@ Daily_solar::Daily_solar(const std::string& i_algoname, const std::string& i_par
std::string Daily_solar::toString() const
{
stringstream ss;
ostringstream ss;
ss << right << setw(10) << parname << "::" << left << setw(15) << algo;
return ss.str();
}
......
......@@ -27,6 +27,10 @@
#include <vector>
#include <map>
#ifdef WIN32
#pragma warning(disable:4512) //we don't need any = operator!
#endif
namespace mio {
/**
* @page resampling Resampling overview
......
Supports Markdown
0%