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

Method conditionIsTrue

lib/importproject.cpp:608–619  ·  view source on GitHub ↗

see https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-conditions properties are .NET String objects and you can call any of its members on them

Source from the content-addressed store, hash-verified

606 // see https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-conditions
607 // properties are .NET String objects and you can call any of its members on them
608 bool conditionIsTrue(const ProjectConfiguration &p, const std::string &filename, std::vector<std::string> &errors) const {
609 if (mCondition.empty())
610 return true;
611 try {
612 return evalCondition(mCondition, p);
613 }
614 catch (const std::runtime_error& r)
615 {
616 errors.emplace_back(filename + ": Can not evaluate condition '" + mCondition + "': " + r.what());
617 return false;
618 }
619 }
620
621 static bool evalCondition(const std::string& condition, const ProjectConfiguration &p) {
622 std::string c = '(' + condition + ")";

Callers 1

importVcxprojMethod · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected