00001 // -*- C++ -*- 00002 // 00003 // $Id: ParserContext.inl 77257 2007-02-20 17:27:00Z johnnyw $ 00004 00005 #include <algorithm> 00006 00007 ACEXML_INLINE 00008 ACEXML_Parser_Context::ACEXML_Parser_Context() 00009 : instream_ (0), 00010 locator_ (0) 00011 { 00012 00013 } 00014 00015 ACEXML_INLINE 00016 ACEXML_Parser_Context::ACEXML_Parser_Context (ACEXML_InputSource* instream, 00017 ACEXML_LocatorImpl* locator) 00018 : instream_ (instream), 00019 locator_ (locator) 00020 { 00021 00022 } 00023 00024 ACEXML_INLINE 00025 ACEXML_Parser_Context::ACEXML_Parser_Context (const ACEXML_Parser_Context& src) 00026 : instream_ (src.instream_), 00027 locator_ (src.locator_) 00028 { 00029 00030 } 00031 00032 ACEXML_INLINE bool 00033 ACEXML_Parser_Context::operator!= (const ACEXML_Parser_Context& src) 00034 { 00035 return (this->instream_ != src.instream_ && this->locator_ != src.locator_); 00036 } 00037 00038 ACEXML_INLINE ACEXML_Parser_Context& 00039 ACEXML_Parser_Context::operator= (const ACEXML_Parser_Context& src) 00040 { 00041 ACEXML_Parser_Context tmp (src); 00042 std::swap (this->instream_, tmp.instream_); 00043 std::swap (this->locator_, tmp.locator_); 00044 return *this; 00045 } 00046 00047 00048 ACEXML_INLINE ACEXML_InputSource* 00049 ACEXML_Parser_Context::getInputSource (void) 00050 { 00051 return this->instream_; 00052 } 00053 00054 ACEXML_INLINE ACEXML_LocatorImpl* 00055 ACEXML_Parser_Context::getLocator (void) 00056 { 00057 return this->locator_; 00058 } 00059 00060 ACEXML_INLINE void 00061 ACEXML_Parser_Context::setInputSource (ACEXML_InputSource* ip) 00062 { 00063 this->instream_ = ip; 00064 } 00065 00066 ACEXML_INLINE void 00067 ACEXML_Parser_Context::setLocator (ACEXML_LocatorImpl* locator) 00068 { 00069 this->locator_ = locator; 00070 } 00071 00072 ACEXML_INLINE void 00073 ACEXML_Parser_Context::reset (void) 00074 { 00075 this->instream_ = 0; 00076 this->locator_ = 0; 00077 }