Changeset 33

Show
Ignore:
Timestamp:
07/01/06 07:33:49 (2 years ago)
Author:
yossarian
Message:

added opApply() to tinyxml

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tinyxml.d

    r30 r33  
    846846    } 
    847847 
    848  
     848    int opApply(int delegate(inout TiXmlNode) dg) 
     849    { 
     850        int res = 0; 
     851        auto a = FirstChild(); 
     852        while (! (a is null)) 
     853        { 
     854            res = dg(a); 
     855            if (res) 
     856                break; 
     857             
     858            a = a.NextSibling; 
     859        } 
     860        return res; 
     861    } 
    849862    /** An alternate way to walk the children of a node. 
    850863        One way to iterate over nodes is: 
     
    863876        first. IterateChildren will return null when done. 
    864877    */ 
     878     
     879     
    865880    TiXmlNode IterateChildren( TiXmlNode previous ) 
    866881    {