MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / parse

Method parse

lib/analyzerinfo.cpp:215–240  ·  view source on GitHub ↗

TODO: report detailed errors?

Source from the content-addressed store, hash-verified

213
214// TODO: report detailed errors?
215bool AnalyzerInformation::Info::parse(const std::string& filesTxtLine) {
216 const std::string::size_type sep1 = filesTxtLine.find(sep);
217 if (sep1 == std::string::npos)
218 return false;
219 const std::string::size_type sep2 = filesTxtLine.find(sep, sep1+1);
220 if (sep2 == std::string::npos)
221 return false;
222 const std::string::size_type sep3 = filesTxtLine.find(sep, sep2+1);
223 if (sep3 == std::string::npos)
224 return false;
225
226 if (sep3 == sep2 + 1)
227 fsFileId = 0;
228 else {
229 try {
230 fsFileId = std::stoi(filesTxtLine.substr(sep2+1, sep3-sep2-1));
231 } catch (const std::exception&) {
232 return false;
233 }
234 }
235
236 afile = filesTxtLine.substr(0, sep1);
237 cfg = filesTxtLine.substr(sep1+1, sep2-sep1-1);
238 sourceFile = filesTxtLine.substr(sep3+1);
239 return true;
240}
241
242std::string AnalyzerInformation::processFilesTxt(const std::string& buildDir, const std::function<void(const char* checkattr, const tinyxml2::XMLElement* e, const Info& filesTxtInfo)>& handler, bool debug)
243{

Callers 2

processFilesTxtMethod · 0.45

Calls 1

findMethod · 0.45

Tested by

no test coverage detected