Tree
- Implemented ::removeAllBranches.
This commit is contained in:
13
src/Tree.cpp
13
src/Tree.cpp
@@ -91,6 +91,19 @@ void Tree::removeBranch (Tree* branch)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
void Tree::removeAllBranches ()
|
||||||
|
{
|
||||||
|
for (std::vector <Tree*>::iterator i = _branches.begin ();
|
||||||
|
i != _branches.end ();
|
||||||
|
++i)
|
||||||
|
{
|
||||||
|
delete *i;
|
||||||
|
}
|
||||||
|
|
||||||
|
_branches.clear ();
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Tree::replaceBranch (Tree* from, Tree* to)
|
void Tree::replaceBranch (Tree* from, Tree* to)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public:
|
|||||||
|
|
||||||
Tree* addBranch (Tree*);
|
Tree* addBranch (Tree*);
|
||||||
void removeBranch (Tree*);
|
void removeBranch (Tree*);
|
||||||
|
void removeAllBranches ();
|
||||||
void replaceBranch (Tree*, Tree*);
|
void replaceBranch (Tree*, Tree*);
|
||||||
|
|
||||||
void attribute (const std::string&, const std::string&);
|
void attribute (const std::string&, const std::string&);
|
||||||
|
|||||||
Reference in New Issue
Block a user