diff --git a/BaseLib/StringTools.cpp b/BaseLib/StringTools.cpp index ff14d58e6de30af0a8737f7cfa39cb4fe60231ad..d43673855e52eeebf2d656e154559a061ceef3e1 100644 --- a/BaseLib/StringTools.cpp +++ b/BaseLib/StringTools.cpp @@ -106,66 +106,3 @@ std::string format(const char* format_str, ... ) } } // end namespace BaseLib - -#ifdef MSVC -void correctScientificNotation(std::string filename, std::size_t precision) -{ - std::ifstream stream; - std::ofstream outputStream; - - stream.open(filename.c_str()); - std::string tmpFilename = filename + ".tmp"; - outputStream.open(tmpFilename.c_str()); - - if (!stream) - { - WARN("correctScientificNotation: fstream is not open."); - return; - } - - std::string line; - - // Iterate over lines in stream - while (getline(stream, line)) - { - std::string word; - std::istringstream iss(line); - // Iterate over all words in line - while (iss >> word) - { - // Search for e+0 - std::size_t exponentPosition = word.find("e+0", precision); - if (exponentPosition == std::string::npos) - // If not found search for e-0 - exponentPosition = word.find("e-0", precision); - if (exponentPosition != std::string::npos) - { - std::size_t wordSize = word.size(); - std::size_t exponentSize = wordSize - exponentPosition; - - if(exponentSize > 4) - { - // Erase the leading zero considering trailing characters - int i = wordSize - 1; - while (!isdigit(word[i])) - --i; - - std::size_t erasePos = wordSize - 3 - (wordSize - 1 - i); - std::string eraseString = word.substr(erasePos, 1); - if (eraseString.find("0") != std::string::npos) - word.erase(erasePos, 1); - } - } - - outputStream << word << " "; - } - outputStream << "\n"; - } - - stream.close(); - outputStream.close(); - - remove(filename.c_str()); - rename(tmpFilename.c_str(), filename.c_str()); -} -#endif diff --git a/BaseLib/StringTools.h b/BaseLib/StringTools.h index 7702d794a5f9e5b363050a90ef38fd3e939d866b..1f3b86e26bbd939c6619c2352b35839fb46f0301 100644 --- a/BaseLib/StringTools.h +++ b/BaseLib/StringTools.h @@ -90,7 +90,3 @@ std::string const& tostring(std::string const& value); std::string format(const char* format_string, ... ); } // end namespace BaseLib - -#ifdef MSVC -void correctScientificNotation(std::string filename, std::size_t precision = 0); -#endif