Tree::unTag

- Added a method for removing a tag.
This commit is contained in:
Paul Beckingham 2013-08-31 18:44:36 -04:00
parent 04fb751678
commit e4671dd518
2 changed files with 15 additions and 0 deletions

View file

@ -177,6 +177,20 @@ void Tree::tag (const std::string& tag)
_tags.push_back (tag); _tags.push_back (tag);
} }
////////////////////////////////////////////////////////////////////////////////
void Tree::unTag (const std::string& tag)
{
std::vector <std::string>::iterator i;
for (i = _tags.begin (); i != _tags.end (); ++i)
{
if (*i == tag)
{
_tags.erase (i);
break;
}
}
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
int Tree::count () const int Tree::count () const
{ {

View file

@ -55,6 +55,7 @@ public:
bool hasTag (const std::string&) const; bool hasTag (const std::string&) const;
void tag (const std::string&); void tag (const std::string&);
void unTag (const std::string&);
int count () const; int count () const;