From e4671dd518323f44a2afc7c863b5949b542256db Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 31 Aug 2013 18:44:36 -0400 Subject: [PATCH] Tree::unTag - Added a method for removing a tag. --- src/parser/Tree.cpp | 14 ++++++++++++++ src/parser/Tree.h | 1 + 2 files changed, 15 insertions(+) diff --git a/src/parser/Tree.cpp b/src/parser/Tree.cpp index ac7d399db..f0897d88f 100644 --- a/src/parser/Tree.cpp +++ b/src/parser/Tree.cpp @@ -177,6 +177,20 @@ void Tree::tag (const std::string& tag) _tags.push_back (tag); } +//////////////////////////////////////////////////////////////////////////////// +void Tree::unTag (const std::string& tag) +{ + std::vector ::iterator i; + for (i = _tags.begin (); i != _tags.end (); ++i) + { + if (*i == tag) + { + _tags.erase (i); + break; + } + } +} + //////////////////////////////////////////////////////////////////////////////// int Tree::count () const { diff --git a/src/parser/Tree.h b/src/parser/Tree.h index 28951e8cc..19c36c884 100644 --- a/src/parser/Tree.h +++ b/src/parser/Tree.h @@ -55,6 +55,7 @@ public: bool hasTag (const std::string&) const; void tag (const std::string&); + void unTag (const std::string&); int count () const;