Rename ErrorMessage::toText() to ErrorMessage::toString().

This commit is contained in:
Kimmo Varis 2010-07-14 18:31:05 +03:00
parent 05adb285c5
commit fa0f6edacf
7 changed files with 9 additions and 9 deletions

View File

@ -108,6 +108,6 @@ void CppCheckExecutor::reportErr(const ErrorLogger::ErrorMessage &msg)
}
else
{
reportErr(msg.toText(_settings._outputFormat));
reportErr(msg.toString(_settings._outputFormat));
}
}

View File

@ -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);

View File

@ -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())

View File

@ -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)
{

View File

@ -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

View File

@ -385,7 +385,7 @@ private:
loc.file = "ab/cd/../ef.h";
errorMessage._callStack.push_back(loc);
ASSERT_EQUALS("<error file=\"ab/ef.h\" line=\"0\" id=\"\" severity=\"\" msg=\"\"/>", 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("<error file=\"some/{file}file.cpp\" line=\"10\" id=\"testId\" severity=\"testSeverity\" msg=\"long testMessage\"/>", 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()

View File

@ -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;
}