home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / examples / xml / tagreader / structureparser.cpp < prev    next >
C/C++ Source or Header  |  2001-10-11  |  1KB  |  36 lines

  1. /****************************************************************************
  2. ** $Id:  qt/structureparser.cpp   3.0.0   edited Jul 3 16:08 $
  3. **
  4. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  5. **
  6. ** This file is part of an example program for Qt.  This example
  7. ** program may be used, distributed and modified without limitation.
  8. **
  9. *****************************************************************************/
  10.  
  11. #include "structureparser.h"
  12.  
  13. #include <stdio.h>
  14. #include <qstring.h>
  15.  
  16. bool StructureParser::startDocument()
  17. {
  18.     indent = "";
  19.     return TRUE;
  20. }
  21.  
  22. bool StructureParser::startElement( const QString&, const QString&, 
  23.                                     const QString& qName, 
  24.                                     const QXmlAttributes& )
  25. {
  26.     printf( "%s%s\n", (const char*)indent, (const char*)qName );
  27.     indent += "    ";
  28.     return TRUE;
  29. }
  30.  
  31. bool StructureParser::endElement( const QString&, const QString&, const QString& )
  32. {
  33.     indent.remove( 0, 4 );
  34.     return TRUE;
  35. }
  36.