X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlugins%2FJSONReader%2Fplugin%2FJSONReaderModule%2FvtkJSONReader.cxx;h=1faa2a79198d20a832ae78feaa1b3e1155416363;hb=1872421989f63893a0461902eb572143d19f388e;hp=6160f29d7b6a7cb5a9cdd2261dd1352f57f9368a;hpb=1b88bf920850aabea9625aa061fd4ec8d4bd5210;p=modules%2Fparavis.git diff --git a/src/Plugins/JSONReader/plugin/JSONReaderModule/vtkJSONReader.cxx b/src/Plugins/JSONReader/plugin/JSONReaderModule/vtkJSONReader.cxx index 6160f29d..1faa2a79 100644 --- a/src/Plugins/JSONReader/plugin/JSONReaderModule/vtkJSONReader.cxx +++ b/src/Plugins/JSONReader/plugin/JSONReaderModule/vtkJSONReader.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2015-2019 CEA/DEN, EDF R&D +// Copyright (C) 2015-2023 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -34,7 +34,7 @@ #include #include - +#include // Key words #define MD "_metadata" #define CMT "_comment" @@ -54,11 +54,11 @@ vtkJSONException::vtkJSONException(const char *reason) : Reason(reason) { } //--------------------------------------------------- -vtkJSONException::~vtkJSONException() throw () { +vtkJSONException::~vtkJSONException() noexcept { } //--------------------------------------------------- -const char* vtkJSONException::what() const throw() { +const char* vtkJSONException::what() const noexcept { return Reason.c_str(); } @@ -69,7 +69,7 @@ public: typedef std::vector > > DataType; Container(){} void initKeys(std::vector &keys, std::string &err) { - for(int i = 0; i < keys.size(); i++) { + for(int i = 0; i < (int)keys.size(); i++) { if( !checkVar(keys[i].c_str()) ) { std::ostringstream oss; oss<<"Bad key value '"<Parse(root, output_table); return 1; } - catch(vtkJSONException e) { + catch(vtkJSONException& e) { std::ostringstream oss; oss<HasObserver("ErrorEvent") ) @@ -183,7 +183,7 @@ int vtkJSONReader::CanParseFile(const char *fname, Json::Value &root) return 0; } - ifstream file; + std::ifstream file; std::ostringstream oss; bool parsedSuccess = true; Json::Reader reader; @@ -251,10 +251,10 @@ void vtkJSONReader::Parse(Json::Value& root, vtkTable *table) { jSONListOfNames = jSONMetaData.get(SHT, Json::Value::null); std::ostringstream oss; oss<< "Short Names : [ "; - for (int i = 0; i < jSONListOfNames.size(); i++) { + for (int i = 0; i < (int)jSONListOfNames.size(); i++) { oss << "'" << jSONListOfNames[i].asString() << "'"; short_names.push_back(jSONListOfNames[i].asString()); - if ( i != jSONListOfNames.size() - 1 ) { + if ( i != (int)jSONListOfNames.size() - 1 ) { oss << ", "; } } @@ -267,9 +267,9 @@ void vtkJSONReader::Parse(Json::Value& root, vtkTable *table) { jSONListOfLongName = jSONMetaData.get(LNG, Json::Value::null); std::ostringstream oss; oss << "Long Names : [ "; - for (int i = 0; i < jSONListOfLongName.size(); ++i) { + for (int i = 0; i < (int)jSONListOfLongName.size(); ++i) { oss << "'" << jSONListOfLongName[i].asString() << "'"; - if ( i != jSONListOfLongName.size()-1 ) { + if ( i != (int)jSONListOfLongName.size()-1 ) { oss << ", "; } } @@ -281,9 +281,9 @@ void vtkJSONReader::Parse(Json::Value& root, vtkTable *table) { hasUnits = true; std::ostringstream oss; oss << "Units : [ "; - for (int i = 0; i < jSONListOfUnits.size(); ++i) { + for (int i = 0; i < (int)jSONListOfUnits.size(); ++i) { oss << "'" << jSONListOfUnits[i].asString() << "'"; - if ( i != jSONListOfUnits.size()-1 ) { + if ( i != (int)jSONListOfUnits.size()-1 ) { oss << ", "; } } @@ -333,7 +333,7 @@ void vtkJSONReader::Parse(Json::Value& root, vtkTable *table) { } initContainer = true; } - for(int i=0; i < members.size(); i++) { + for(int i=0; i < (int)members.size(); i++) { Json::Value val = (*it).get(members[i],Json::Value::null); double value = 0.0; switch (val.type()) { @@ -374,7 +374,7 @@ void vtkJSONReader::Parse(Json::Value& root, vtkTable *table) { if(data.size() > 0) nbRows = data[0].second.size(); - for(int i = 0; i < data.size(); i++) { + for(int i = 0; i < (int)data.size(); i++) { vtkDoubleArray* newCol = vtkDoubleArray::New(); newCol->SetNumberOfValues(nbRows); std::string name = data[i].first; @@ -386,7 +386,7 @@ void vtkJSONReader::Parse(Json::Value& root, vtkTable *table) { } name += "]"; newCol->SetName(name.c_str()); - for(int j = 0; j < data[i].second.size(); j++) { + for(int j = 0; j < (int)data[i].second.size(); j++) { newCol->SetValue(j, data[i].second[j]); } table->AddColumn(newCol);