summaryrefslogtreecommitdiff
path: root/ACEXML/parser/parser/ParserContext.h
blob: 6bb7c4122ade1dd15d4f215e707ca5624deec21c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// -*- C++ -*-

//=============================================================================
/**
 *  @file    ParserContext.h
 *
 *  $Id$
 *
 *  @author Krishnakumar B <kitty@cs.wustl.edu>
 */
//=============================================================================

#ifndef ACEXML_PARSER_CONTEXT_H
#define ACEXML_PARSER_CONTEXT_H

#include /**/ "ace/pre.h"
#include "ACEXML/parser/parser/Parser_export.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ACEXML/common/XML_Types.h"
#include "ACEXML/common/InputSource.h"
#include "ACEXML/common/Locator.h"
#include "ACEXML/common/LocatorImpl.h"
#include "ace/Functor.h"
#include "ace/Containers_T.h"
#include "ace/Swap.h"

class ACEXML_PARSER_Export ACEXML_Parser_Context
{
public:
  /// Default constructor
  ACEXML_Parser_Context();

  /// Constructor which initializes the context
  ACEXML_Parser_Context (ACEXML_InputSource* instream,
                         ACEXML_LocatorImpl* locator);

  /// Comparison operator
  bool operator!= (const ACEXML_Parser_Context& src);

  /// Destructor
  virtual ~ACEXML_Parser_Context();

  /// Reset the parser context. This does not free up the memory. Only sets
  /// it to zero. Meant to be called after a context is pushed on to a
  /// stack.
  void reset (void);

  /// Get the underlying input source.
  virtual ACEXML_InputSource* getInputSource(void);

  /// Get the underlying locator.
  virtual ACEXML_LocatorImpl* getLocator(void);

  /// Set the underlying input source.
  virtual void setInputSource(ACEXML_InputSource* ip);

  /// Set the underlying locator.
  virtual void setLocator(ACEXML_LocatorImpl* locator);

private:

  /// Copy constructor
  ACEXML_Parser_Context (const ACEXML_Parser_Context& src);

  /// Assignment operator
  ACEXML_Parser_Context& operator= (const ACEXML_Parser_Context& src);

  /// Current input char stream.
  ACEXML_InputSource *instream_;

  /// Current Locator which provides line no., column no. systemId and publicId
  ACEXML_LocatorImpl* locator_;
};

#if defined (__ACEXML_INLINE__)
# include "ACEXML/parser/parser/ParserContext.inl"
#endif /* __ACEXML_INLINE__ */

#include /**/ "ace/post.h"

#endif /* ACEXML_PARSER_CONTEXT_H */