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

Method GetUnsignedMap

src/Base/Parameter.cpp:918–946  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

916}
917
918std::vector<std::pair<std::string, unsigned long>> ParameterGrp::GetUnsignedMap(const char* sFilter) const
919{
920 std::vector<std::pair<std::string, unsigned long>> vrValues;
921 if (!_pGroupNode) {
922 return vrValues;
923 }
924
925 std::string Name;
926 const int base = 10;
927
928 DOMElement* pcTemp = FindElement(_pGroupNode, "FCUInt");
929 while (pcTemp) {
930 Name = StrX(pcTemp->getAttribute(XStrLiteral("Name").unicodeForm())).c_str();
931 // check on filter condition
932 if (!sFilter || Name.find(sFilter) != std::string::npos) {
933 vrValues.emplace_back(
934 Name,
935 (strtoul(
936 StrX(pcTemp->getAttribute(XStrLiteral("Value").unicodeForm())).c_str(),
937 nullptr,
938 base
939 ))
940 );
941 }
942 pcTemp = FindNextElement(pcTemp, "FCUInt");
943 }
944
945 return vrValues;
946}
947
948double ParameterGrp::GetFloat(const char* Name, double dPreset) const
949{

Callers 9

getUnsignedsMethod · 0.80
getContentsMethod · 0.80
revertMethod · 0.80
copyTemplateParametersFunction · 0.80
setStateMethod · 0.80
onGroupSelectedMethod · 0.80
onCreateUIntItemMethod · 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