Changeset 6417 for code/trunk/src/libraries/core/NamespaceNode.cc
- Timestamp:
- Dec 25, 2009, 10:23:58 PM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/NamespaceNode.cc
r5781 r6417 43 43 { 44 44 for (std::map<std::string, NamespaceNode*>::iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ) 45 delete ( (*(it++)).second);45 delete (it++)->second; 46 46 } 47 47 … … 50 50 std::set<NamespaceNode*> nodes; 51 51 52 if ( (name.size() == 0) || (name == ""))52 if (name.empty()) 53 53 { 54 54 nodes.insert(this); … … 89 89 it = this->subnodes_.insert(this->subnodes_.begin(), std::pair<std::string, NamespaceNode*>(firstPart, new NamespaceNode(firstPart, this))); 90 90 91 if ( (*it).second->isHidden())91 if (it->second->isHidden()) 92 92 { 93 93 COUT(2) << "Warning: Subnamespace '" << firstPart << "' in namespace '" << this->name_ << "' is hidden and can't be accessed." << std::endl; … … 96 96 else 97 97 { 98 nodes = (*it).second->getNodeRelative(secondPart);98 nodes = it->second->getNodeRelative(secondPart); 99 99 } 100 100 } … … 105 105 for (std::map<std::string, NamespaceNode*>::iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it) 106 106 { 107 if ( (*it).first.find(firstPart) == ((*it).first.size() - firstPart.size()))107 if (it->first.find(firstPart) == (it->first.size() - firstPart.size())) 108 108 { 109 std::set<NamespaceNode*> temp2 = (*it).second->getNodeRelative(secondPart);109 std::set<NamespaceNode*> temp2 = it->second->getNodeRelative(secondPart); 110 110 nodes.insert(temp2.begin(), temp2.end()); 111 111 bFoundMatchingNamespace = true; … … 133 133 { 134 134 for (std::map<std::string, NamespaceNode*>::const_iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it) 135 if ( (*it).second->includes(ns))135 if (it->second->includes(ns)) 136 136 return true; 137 137 } … … 154 154 output += ", "; 155 155 156 output += (*it).second->toString();156 output += it->second->toString(); 157 157 } 158 158 159 output += ")";159 output += ')'; 160 160 } 161 161 … … 165 165 std::string NamespaceNode::toString(const std::string& indentation) const 166 166 { 167 std::string output = (indentation + this->name_ + "\n");167 std::string output = (indentation + this->name_ + '\n'); 168 168 169 169 for (std::map<std::string, NamespaceNode*>::const_iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it) 170 output += (*it).second->toString(indentation + " ");170 output += it->second->toString(indentation + " "); 171 171 172 172 return output;
Note: See TracChangeset
for help on using the changeset viewer.