示例#1
0
//------------------------------------------------------------------------------
void XMLTreeWriter::Write ()
{
    OpenTree();

	cur = t->GetRoot();
        count = 0;

    while (cur)
    {
        if (cur->GetChild())
        {
             count++;
             OpenNode();
             NodeInfo();
                
            stk.push (cur);
            cur = cur->GetChild();
        }
        else
        {
            count++;
            OpenNode();
            NodeInfo();
            CloseNode();
            while (!stk.empty() && (cur->GetSibling() == NULL))
            {
                CloseNode();
                cur = stk.top();
                stk.pop();
            }
            if (stk.empty())
                cur = NULL;
            else
            {
                cur = cur->GetSibling();
            }
        }
    }
    CloseTree();

}
示例#2
0
void CloseWindow(Widget w, caddr_t client_data, caddr_t call_data) {
  ClosingWindow=1;
  CloseTree(w,client_data,call_data);
  ClosingWindow=0;
}