Changed findByAttr to be a const function.
This commit is contained in:
parent
464fc1409d
commit
dad3088736
2 changed files with 3 additions and 3 deletions
|
|
@ -819,10 +819,10 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
XML_Node* XML_Node::findByAttr(const string& attr,
|
||||
const string& val) {
|
||||
const string& val) const {
|
||||
if (hasAttrib(attr)) {
|
||||
if (attrib(attr) == val) {
|
||||
return this;
|
||||
return const_cast<XML_Node*>(this);
|
||||
}
|
||||
}
|
||||
XML_Node* r = 0;
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ namespace Cantera {
|
|||
*/
|
||||
XML_Node* findID(const std::string& id, const int depth=100) const;
|
||||
|
||||
XML_Node* findByAttr(const std::string& attr, const std::string& val);
|
||||
XML_Node* findByAttr(const std::string& attr, const std::string& val) const;
|
||||
const XML_Node* findByName(const std::string& nm) const;
|
||||
XML_Node* findByName(const std::string& nm);
|
||||
void getChildren(std::string name, std::vector<XML_Node*>& children) const;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue