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

Method getChild

lib/clangimport.cpp:360–369  ·  view source on GitHub ↗

* @throws InternalError thrown if index is out of bounds */

Source from the content-addressed store, hash-verified

358 * @throws InternalError thrown if index is out of bounds
359 */
360 AstNodePtr getChild(int c) {
361 if (c >= children.size()) {
362 std::ostringstream err;
363 err << "ClangImport: AstNodePtr::getChild(" << c << ") out of bounds. children.size=" << children.size() << " " << nodeType;
364 for (const std::string &s: mExtTokens)
365 err << " " << s;
366 throw InternalError(nullptr, err.str());
367 }
368 return children[c];
369 }
370 private:
371 /**
372 * @throws InternalError thrown if CXXForRangeStmt cannot be imported

Callers 1

createTokensMethod · 0.80

Calls 2

sizeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected