MCPcopy Create free account
hub / github.com/Yaafe/Yaafe / getStringParam

Method getStringParam

src_cpp/yaafe-core/Component.cpp:51–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 const std::string EMPTY_STRING("");
50
51 std::string Component::getStringParam(const std::string& id, const ParameterMap& params)
52 {
53 ParameterMap::const_iterator it=params.find(id);
54 if (it!=params.end()) {
55 if (it->second.size()==0) {
56 cerr << "ERROR: parameter " << id << " is empty !" << endl;
57 return EMPTY_STRING;
58 }
59 return it->second;
60 }
61 ParameterDescriptorList pList = getParameterDescriptorList();
62 for (ParameterDescriptorList::const_iterator descIt=pList.begin();
63 descIt!=pList.end(); descIt++)
64 {
65 if (descIt->m_identifier==id)
66 return descIt->m_defaultValue;
67 }
68 cerr << "ERROR: no parameter " << id << " for component " << getIdentifier() << " !" << endl;
69 return EMPTY_STRING;
70 }
71
72 int Component::getIntParam(const std::string& id, const ParameterMap& params)
73 {

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected