;
; *****************************************************************************
; * XMLNodeAutoexp.txt - implementation file for basic XML parser written     *
; * in ANSI C++  for portability. It works by using recursion and a node tree *
; * for breaking down the elements of an XML document.                        *
; *                                                                           *
; * @version     V2.44                                                        *
; * @author      Frank Vanden Berghen                                         *
; *                                                                           *
; * Copyright (c) 2002, Frank Vanden Berghen - All rights reserved.           *
; * See the file "AFPL-license.txt about the licensing terms                  *
; *                                                                           *
; *****************************************************************************
;
; This file contains some really cool "tweaks" to apply on Visual Studio .NET 2005 debugger and above.
; These "tweaks" allows to easily visually inspect the contents of the XMLNode objects inside the debugger.
; Believe me, once you have seen inside the debugger the "smooth" display of the XMLNode objects, you cannot live without it anymore!
; This is a really BIG improvement of the usage of the XMLNode class inside the Visual Studio debugger!
; This way, it has never been so easy to manipulate large XML documents. I really love the Visual Studio Debugger!

; You should thanks Sabrina Wenig because she is the person that gave me the original idea for the "smooth" display of the 
; XMLNode objects inside the debugger.

; The explanation required to make the cool "tweaks" follows (use at your own risk)!
; First read all the english comments of this file until the end and then proceed.

; Open inside notepad the file:
; %Visual Studio root dir%\Common7\Packages\Debugger\autoexp.dat
; ... and,search for a line that contains "[Visualizer]"
; just after this line,you include (copy/paste) the following lines:

XMLClear{
    preview (#( [$c.lpszOpenTag,sb], [$c.lpszValue,sb], [$c.lpszCloseTag,sb] ))
}

XMLAttribute{
    preview (#( [$c.lpszName,sb], "=", [$c.lpszValue,s]))
}

XMLNode::XMLNodeDataTag{
    preview (
       #if ($c.lpszName == 0) ("root node")
       #elif ($c.isDeclaration== 0)
           (#(
               "<",[$c.lpszName,sb],">, nChild=",$c.nChild,
               ", nAttr=",$c.nAttribute,", nText=",$c.nText
           ))
       #else
           (#(
               "<?",[$c.lpszName,sb],"?>, nChild=",$c.nChild,
               ", nAttr=",$c.nAttribute,", nText=",$c.nText
           ))    )
    children (
        #(
;            [raw members]: [$c,!],
;         Childs:
                      #array ( expr : $c.pChild[$i],     size : $c.nChild ),
          Attributes: #array ( expr : $c.pAttribute[$i], size : $c.nAttribute ),
          Text:       #array ( expr : $c.pText[$i],      size : $c.nText ),
          Clear:      #array ( expr : $c.pClear[$i],     size : $c.nClear ),
          #if ( $c.pParent != 0) 
          ( #(
              parent: *($c.pParent)
          ))
        )
    )
}

XMLNode{
    preview (
       #if ($c.d == 0) ("emptyXMLNode")
       #elif ((*$c.d).lpszName == 0) ("root node")
       #elif ((*$c.d).isDeclaration== 0)
           (#(
               "<",[(*$c.d).lpszName,sb],">, nChild=",(*$c.d).nChild,
               ", nAttr=",(*$c.d).nAttribute,", nText=",(*$c.d).nText
           ))
       #else
           (#(
               "<?",[(*$c.d).lpszName,sb],"?>, nChild=",(*$c.d).nChild,
               ", nAttr=",(*$c.d).nAttribute,", nText=",(*$c.d).nText
           ))
    )
    children (
        #(
;          [raw members]: [(*$c.d),!],
;         Childs:
                      #array ( expr : (*($c.d)).pChild[$i],     size : (*($c.d)).nChild ),
          Attributes: #array ( expr : (*($c.d)).pAttribute[$i], size : (*($c.d)).nAttribute ),
          Text:       #array ( expr : (*($c.d)).pText[$i],      size : (*($c.d)).nText ),
          Clear:      #array ( expr : (*($c.d)).pClear[$i],     size : (*($c.d)).nClear ),
           #if ( (*($c.d)).pParent != 0) 
           ( #(
              parent: *((*($c.d)).pParent)
           ))
        )
    )
}


; If you don't want to see the "parent" node inside the debugger display, then use the 
; following lines INSTEAD of the line above (the lines below contain an alternative "simplified 
; view" of the XMLNode objects inside the debugger)

XMLClear{
    preview (#( [$c.lpszOpenTag,sb], [$c.lpszValue,sb], [$c.lpszCloseTag,sb] ))
}

XMLAttribute{
    preview (#( [$c.lpszName,sb], "=", [$c.lpszValue,s]))
}

XMLNode{
    preview (
       #if ($c.d == 0) ("emptyXMLNode")
       #elif ((*$c.d).lpszName == 0) ("root node")
       #elif ((*$c.d).isDeclaration== 0)
           (#(
               "<",[(*$c.d).lpszName,sb],">, nChild=",(*$c.d).nChild,
               ", nAttr=",(*$c.d).nAttribute,", nText=",(*$c.d).nText
           ))
       #else
           (#(
               "<?",[(*$c.d).lpszName,sb],"?>, nChild=",(*$c.d).nChild,
               ", nAttr=",(*$c.d).nAttribute,", nText=",(*$c.d).nText
           ))
    )
    children (
        #(
;          [raw members]: [(*$c.d),!],
;         Childs:
                      #array ( expr : (*($c.d)).pChild[$i],     size : (*($c.d)).nChild ),
          Attributes: #array ( expr : (*($c.d)).pAttribute[$i], size : (*($c.d)).nAttribute ),
          Text:       #array ( expr : (*($c.d)).pText[$i],      size : (*($c.d)).nText ),
          Clear:      #array ( expr : (*($c.d)).pClear[$i],     size : (*($c.d)).nClear ),
        )
    )
}

; Each time a XMLNode object is given as argument to a function, the computer calls the 
; "copy constructor" of the XMLNode object. Inside the debugger, this can be very annoying because
; each time you debug a function where you pass as argument a XMLNode object, you have to "enter" 
; and "go through" the "copy constructor" of the XMLNode class. Usually it means that you have to 
; press many, many times [F11] (and you enter the "copy constructor") and just after [Shift]+[F11]
; (and you exit the copy constructor). To prevent the debugger to always show you the code of the 
; "copy constructor" of the XMLNode class (which you don't care at all), simply add the 3 following 
; lines just BEFORE the line that contains "[Visualizer]":

[ExecutionControl]
XMLNode::XMLNode=NoStepInto
XMLNode::~XMLNode=NoStepInto
