MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / GetBools

Method GetBools

src/Base/Parameter.cpp:740–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

738}
739
740std::vector<bool> ParameterGrp::GetBools(const char* sFilter) const
741{
742 std::vector<bool> vrValues;
743 if (!_pGroupNode) {
744 return vrValues;
745 }
746
747 std::string Name;
748
749 DOMElement* pcTemp = FindElement(_pGroupNode, "FCBool");
750 while (pcTemp) {
751 Name = StrX(pcTemp->getAttribute(XStrLiteral("Name").unicodeForm())).c_str();
752 // check on filter condition
753 if (!sFilter || Name.find(sFilter) != std::string::npos) {
754 if (strcmp(StrX(pcTemp->getAttribute(XStrLiteral("Value").unicodeForm())).c_str(), "1")
755 != 0) {
756 vrValues.push_back(false);
757 }
758 else {
759 vrValues.push_back(true);
760 }
761 }
762 pcTemp = FindNextElement(pcTemp, "FCBool");
763 }
764
765 return vrValues;
766}
767
768std::vector<std::pair<std::string, bool>> ParameterGrp::GetBoolMap(const char* sFilter) const
769{

Callers 6

exerciseFunction · 0.80
platform_win_dialogMethod · 0.80
executeMethod · 0.80
_compute_localMethod · 0.80
TEST_FFunction · 0.80

Calls 6

StrXClass · 0.85
unicodeFormMethod · 0.80
c_strMethod · 0.45
getAttributeMethod · 0.45
findMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected