diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index 88db78051..193ed1c68 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -108,6 +108,6 @@ void CppCheckExecutor::reportErr(const ErrorLogger::ErrorMessage &msg) } else { - reportErr(msg.toText(_settings._outputFormat)); + reportErr(msg.toString(_settings._outputFormat)); } } diff --git a/cli/threadexecutor.cpp b/cli/threadexecutor.cpp index c4403b75e..635faf03f 100644 --- a/cli/threadexecutor.cpp +++ b/cli/threadexecutor.cpp @@ -93,7 +93,7 @@ int ThreadExecutor::handleRead(unsigned int &result) msg.deserialize(buf); // Alert only about unique errors - std::string errmsg = msg.toText(); + std::string errmsg = msg.toString(); if (std::find(_errorList.begin(), _errorList.end(), errmsg) == _errorList.end()) { _errorList.push_back(errmsg); diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 415beaadd..293409795 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -836,7 +836,7 @@ Settings CppCheck::settings() const void CppCheck::reportErr(const ErrorLogger::ErrorMessage &msg) { - std::string errmsg = msg.toText(); + std::string errmsg = msg.toString(); // Alert only about unique errors if (std::find(_errorList.begin(), _errorList.end(), errmsg) != _errorList.end()) diff --git a/lib/errorlogger.cpp b/lib/errorlogger.cpp index 2ec429c15..b4215b588 100644 --- a/lib/errorlogger.cpp +++ b/lib/errorlogger.cpp @@ -169,7 +169,7 @@ void ErrorLogger::ErrorMessage::findAndReplace(std::string &source, const std::s } } -std::string ErrorLogger::ErrorMessage::toText(const std::string &outputFormat) const +std::string ErrorLogger::ErrorMessage::toString(const std::string &outputFormat) const { if (outputFormat.length() == 0) { diff --git a/lib/errorlogger.h b/lib/errorlogger.h index c5d39bf59..81664c5b1 100644 --- a/lib/errorlogger.h +++ b/lib/errorlogger.h @@ -89,7 +89,7 @@ public: * @param outputFormat Empty string to use default output format * or template to be used. E.g. "{file}:{line},{severity},{id},{message}" */ - std::string toText(const std::string &outputFormat = "") const; + std::string toString(const std::string &outputFormat = "") const; /** * Replace all occurances of searchFor with replaceWith in the diff --git a/test/testcppcheck.cpp b/test/testcppcheck.cpp index bde51f028..cc9f1fdd0 100644 --- a/test/testcppcheck.cpp +++ b/test/testcppcheck.cpp @@ -385,7 +385,7 @@ private: loc.file = "ab/cd/../ef.h"; errorMessage._callStack.push_back(loc); ASSERT_EQUALS("", errorMessage.toXML()); - ASSERT_EQUALS("[ab/ef.h:0]: ", errorMessage.toText()); + ASSERT_EQUALS("[ab/ef.h:0]: ", errorMessage.toString()); } void templateFormat() @@ -399,8 +399,8 @@ private: errorMessage._severity = "testSeverity"; errorMessage._msg = "long testMessage"; ASSERT_EQUALS("", errorMessage.toXML()); - ASSERT_EQUALS("[some/{file}file.cpp:10]: (testSeverity) long testMessage", errorMessage.toText()); - ASSERT_EQUALS("testId-some/{file}file.cpp,testSeverity.10?{long testMessage}", errorMessage.toText("{id}-{file},{severity}.{line}?{{message}}")); + ASSERT_EQUALS("[some/{file}file.cpp:10]: (testSeverity) long testMessage", errorMessage.toString()); + ASSERT_EQUALS("testId-some/{file}file.cpp,testSeverity.10?{long testMessage}", errorMessage.toString("{id}-{file},{severity}.{line}?{{message}}")); } void getErrorMessages() diff --git a/test/testsuite.cpp b/test/testsuite.cpp index 7307073d4..8407e8d04 100644 --- a/test/testsuite.cpp +++ b/test/testsuite.cpp @@ -223,5 +223,5 @@ void TestFixture::reportOut(const std::string & outmsg) void TestFixture::reportErr(const ErrorLogger::ErrorMessage &msg) { - errout << msg.toText() << std::endl; + errout << msg.toString() << std::endl; }