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

Method GetBoolMap

src/Base/Parameter.cpp:768–794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

766}
767
768std::vector<std::pair<std::string, bool>> ParameterGrp::GetBoolMap(const char* sFilter) const
769{
770 std::vector<std::pair<std::string, bool>> vrValues;
771 if (!_pGroupNode) {
772 return vrValues;
773 }
774
775 std::string Name;
776
777 DOMElement* pcTemp = FindElement(_pGroupNode, "FCBool");
778 while (pcTemp) {
779 Name = StrX(pcTemp->getAttribute(XStrLiteral("Name").unicodeForm())).c_str();
780 // check on filter condition
781 if (!sFilter || Name.find(sFilter) != std::string::npos) {
782 if (strcmp(StrX(pcTemp->getAttribute(XStrLiteral("Value").unicodeForm())).c_str(), "1")
783 != 0) {
784 vrValues.emplace_back(Name, false);
785 }
786 else {
787 vrValues.emplace_back(Name, true);
788 }
789 }
790 pcTemp = FindNextElement(pcTemp, "FCBool");
791 }
792
793 return vrValues;
794}
795
796long ParameterGrp::GetInt(const char* Name, long lPreset) const
797{

Callers 9

getBoolsMethod · 0.80
getContentsMethod · 0.80
revertMethod · 0.80
restoreStateMethod · 0.80
copyTemplateParametersFunction · 0.80
onGroupSelectedMethod · 0.80
onCreateBoolItemMethod · 0.80
matchesMethod · 0.80
TEST_FFunction · 0.80

Calls 5

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

Tested by

no test coverage detected