Line | |
---|
1 | function tree = move(tree,uida, uidb)
|
---|
2 | % XMLTREE/MOVE Move (move a subtree inside a tree from A to B)
|
---|
3 | %
|
---|
4 | % tree - XMLTree object
|
---|
5 | % uida - initial position of the subtree
|
---|
6 | % uidb - parent of the final position of the subtree
|
---|
7 | %__________________________________________________________________________
|
---|
8 | %
|
---|
9 | % Move a subtree inside a tree from A to B.
|
---|
10 | % The tree parameter must be in input AND in output.
|
---|
11 | %__________________________________________________________________________
|
---|
12 | % Copyright (C) 2002-2015 http://www.artefact.tk/
|
---|
13 |
|
---|
14 | % Guillaume Flandin
|
---|
15 | % $Id: move.m 6480 2015-06-13 01:08:30Z guillaume $
|
---|
16 |
|
---|
17 |
|
---|
18 | %error(nargchk(3,3,nargin));
|
---|
19 |
|
---|
20 | p = tree.tree{uida}.parent;
|
---|
21 | tree.tree{p}.contents(find(tree.tree{p}.contents==uida)) = [];
|
---|
22 | tree.tree(uidb).contents = [tree.tree(uidb).contents uida];
|
---|
Note: See
TracBrowser
for help on using the repository browser.