00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file ParserContext.h 00006 * 00007 * ParserContext.h,v 1.5 2004/04/23 03:45:34 ossama Exp 00008 * 00009 * @author Krishnakumar B <kitty@cs.wustl.edu> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef ACEXML_PARSER_CONTEXT_H 00014 #define ACEXML_PARSER_CONTEXT_H 00015 00016 #include /**/ "ace/pre.h" 00017 #include "ACEXML/parser/parser/Parser_export.h" 00018 00019 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00020 #pragma once 00021 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00022 00023 #include "ACEXML/common/XML_Types.h" 00024 #include "ACEXML/common/InputSource.h" 00025 #include "ACEXML/common/Locator.h" 00026 #include "ACEXML/common/LocatorImpl.h" 00027 #include "ace/Functor.h" 00028 #include "ace/Containers_T.h" 00029 #include "ace/Swap.h" 00030 00031 class ACEXML_PARSER_Export ACEXML_Parser_Context 00032 { 00033 public: 00034 /// Default constructor 00035 ACEXML_Parser_Context(); 00036 00037 /// Constructor which initializes the context 00038 ACEXML_Parser_Context (ACEXML_InputSource* instream, 00039 ACEXML_LocatorImpl* locator); 00040 00041 /// Comparison operator 00042 bool operator!= (const ACEXML_Parser_Context& src); 00043 00044 /// Destructor 00045 virtual ~ACEXML_Parser_Context(); 00046 00047 /// Reset the parser context. This does not free up the memory. Only sets 00048 /// it to zero. Meant to be called after a context is pushed on to a 00049 /// stack. 00050 void reset (void); 00051 00052 /// Get the underlying input source. 00053 virtual ACEXML_InputSource* getInputSource(void); 00054 00055 /// Get the underlying locator. 00056 virtual ACEXML_LocatorImpl* getLocator(void); 00057 00058 /// Set the underlying input source. 00059 virtual void setInputSource(ACEXML_InputSource* ip); 00060 00061 /// Set the underlying locator. 00062 virtual void setLocator(ACEXML_LocatorImpl* locator); 00063 00064 private: 00065 00066 /// Copy constructor 00067 ACEXML_Parser_Context (const ACEXML_Parser_Context& src); 00068 00069 /// Assignment operator 00070 ACEXML_Parser_Context& operator= (const ACEXML_Parser_Context& src); 00071 00072 /// Current input char stream. 00073 ACEXML_InputSource *instream_; 00074 00075 /// Current Locator which provides line no., column no. systemId and publicId 00076 ACEXML_LocatorImpl* locator_; 00077 }; 00078 00079 #if defined (__ACEXML_INLINE__) 00080 # include "ACEXML/parser/parser/ParserContext.inl" 00081 #endif /* __ACEXML_INLINE__ */ 00082 00083 #include /**/ "ace/post.h" 00084 00085 #endif /* ACEXML_PARSER_CONTEXT_H */