mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-07 22:58:34 +02:00
Tree
- Implemented ::removeAllBranches.
This commit is contained in:
parent
fb4bf3efba
commit
1b8671b58e
2 changed files with 14 additions and 0 deletions
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&);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue