https://bugzilla.wikimedia.org/show_bug.cgi?id=30657

--- Comment #3 from Roger Mbiama Assogo <[email protected]> 2011-08-31 13:06:29 
UTC ---
tree.trunk like php inc. ini tree wiki
#include <algorithm>
#include <string>
#include <iostream>
#include "tree.hh"

using namespace std;

int main(int, char **)
   {
   tree<string> tr;
   tree<string>::iterator top, one, two, loc, banana;

   top=tr.begin();
   one=tr.insert(top, "name");
   two=tr.append_child(name, "name2");
   tr.append_child(two, "explorer");
   name=tr.append_child(name, "name2");
   tr.append_child(name,"subName");
   tr.append_child(Name2, "mbiama");
   tr.append_child(one,"three");

   loc=find(tr.begin(), tr.end(), "name2");
   if(loc!=tr.end()) {
   tree<string>::sibling_iterator sib=tr.begin(loc);
   while(sib!=tr.end(loc)) {
     cout << (*sib) << endl;
     ++sib;
     }
   cout << endl;
   tree<string>::iterator sib2=tr.begin(loc);
   tree<string>::iterator end2=tr.end(loc);
   while(sib2!=end2) {
     for(int i=0; i<tr.depth(sib2)-2; ++i) 
        cout << " ";
     cout << (*sib2) << endl;
     ++sib2;
     }
   }
}

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to