StructureHandler.h 1.71 KB
Newer Older
Francois Gygi committed
1 2
////////////////////////////////////////////////////////////////////////////////
//
Francois Gygi committed
3 4 5 6
// Copyright (c) 2008 The Regents of the University of California
//
// This file is part of Qbox
//
Francois Gygi committed
7 8
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
Francois Gygi committed
9 10 11 12 13 14
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
Francois Gygi committed
15 16 17 18 19 20 21 22 23 24
// StructureHandler.h
//
////////////////////////////////////////////////////////////////////////////////

#ifndef STRUCTUREHANDLER_H
#define STRUCTUREHANDLER_H

#include <xercesc/util/XMLUniDefs.hpp>
#include <xercesc/sax2/Attributes.hpp>
#include <string>
25
using namespace xercesc;
Francois Gygi committed
26 27 28 29 30 31

class StructureHandler
{
  private:

  public:
32

Francois Gygi committed
33 34 35 36 37
  // Start of an element handled by the StructureHandler
  virtual void startElement(const XMLCh* const uri,const XMLCh* const localname,
      const XMLCh* const qname, const Attributes& attributes) = 0;

  // End of an element handled by the StructureHandler
38
  virtual void endElement(const XMLCh* const uri, const XMLCh* const localname,
39
      const XMLCh* const qname, std::string& content) = 0;
40

Francois Gygi committed
41 42
  // start a subhandler
  virtual StructureHandler* startSubHandler(const XMLCh* const uri,
43
    const XMLCh* const localname, const XMLCh* const qname,
Francois Gygi committed
44
    const Attributes& attributes) = 0;
45

Francois Gygi committed
46 47
  // end a subhandler
  virtual void endSubHandler(const XMLCh* const uri,
48
    const XMLCh* const localname, const XMLCh* const qname,
Francois Gygi committed
49
    const StructureHandler* const subHandler) = 0;
50

Francois Gygi committed
51 52 53 54
  StructureHandler() {}
  virtual ~StructureHandler() {}
};
#endif