factor out addSuppressionLine from file reading function
This commit is contained in:
parent
8a85b18283
commit
331788246b
|
@ -70,6 +70,16 @@ std::string Settings::Suppressions::parseFile(std::istream &istr)
|
||||||
if (line.length() >= 2 && line[0] == '/' && line[1] == '/')
|
if (line.length() >= 2 && line[0] == '/' && line[1] == '/')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
const std::string errmsg(addSuppressionLine(line));
|
||||||
|
if (!errmsg.empty())
|
||||||
|
return errmsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Settings::Suppressions::addSuppressionLine(const std::string &line)
|
||||||
|
{
|
||||||
std::istringstream lineStream(line);
|
std::istringstream lineStream(line);
|
||||||
std::string id;
|
std::string id;
|
||||||
std::string file;
|
std::string file;
|
||||||
|
@ -112,7 +122,6 @@ std::string Settings::Suppressions::parseFile(std::istream &istr)
|
||||||
const std::string errmsg(addSuppression(id, file, lineNumber));
|
const std::string errmsg(addSuppression(id, file, lineNumber));
|
||||||
if (!errmsg.empty())
|
if (!errmsg.empty())
|
||||||
return errmsg;
|
return errmsg;
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,6 +180,13 @@ public:
|
||||||
*/
|
*/
|
||||||
std::string parseFile(std::istream &istr);
|
std::string parseFile(std::istream &istr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Don't show the given error.
|
||||||
|
* @param str Description of error to suppress (in id:file:line format).
|
||||||
|
* @return error message. empty upon success
|
||||||
|
*/
|
||||||
|
std::string addSuppressionLine(const std::string &line);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Don't show this error. If file and/or line are optional. In which case
|
* @brief Don't show this error. If file and/or line are optional. In which case
|
||||||
* the errorId alone is used for filtering.
|
* the errorId alone is used for filtering.
|
||||||
|
|
Loading…
Reference in New Issue