ACEXML_LocatorImpl is an implementation of ACEXML_Locator. More...
#include <ACEXML/common/LocatorImpl.h>
Public Member Functions | |
ACEXML_LocatorImpl (void) | |
ACEXML_LocatorImpl (const ACEXML_Char *systemId, const ACEXML_Char *publicId) | |
ACEXML_LocatorImpl (const ACEXML_Locator &locator) | |
virtual | ~ACEXML_LocatorImpl (void) |
virtual int | getColumnNumber (void) const |
virtual int | getLineNumber (void) const |
virtual const ACEXML_Char * | getPublicId (void) const |
virtual const ACEXML_Char * | getSystemId (void) const |
void | setColumnNumber (int cn) |
void | setLineNumber (int ln) |
void | setPublicId (const ACEXML_Char *id) |
void | setSystemId (const ACEXML_Char *id) |
void | incrLineNumber () |
void | incrColumnNumber () |
void | reset (void) |
Private Attributes | |
ACEXML_Char * | publicId_ |
ACEXML_Char * | systemId_ |
int | lineNumber_ |
int | columnNumber_ |
ACEXML_LocatorImpl is an implementation of ACEXML_Locator.
This class is available mainly for application writers, who can use it to make a persistent snapshot of a locator at any point during a document parse:
ACEXML_Locator locator; ACEXML_Locator startloc; public void setLocator (ACEXML_Locator locator) { // note the locator this.locator = locator; } public void startDocument () { // save the location of the start of the document // for future use. ACEXML_Locator startloc = new ACEXML_LocatorImpl(locator); }
Normally, parser writers will not use this class, since it is more efficient to provide location information only when requested, rather than constantly updating a Locator object.
Definition at line 61 of file LocatorImpl.h.
ACEXML_LocatorImpl::ACEXML_LocatorImpl | ( | void | ) |
Definition at line 9 of file LocatorImpl.cpp.
: publicId_ (0), systemId_ (0), lineNumber_ (1), columnNumber_ (0) { }
ACEXML_LocatorImpl::ACEXML_LocatorImpl | ( | const ACEXML_Char * | systemId, | |
const ACEXML_Char * | publicId | |||
) |
Construct a locator with systemId and publicId
Definition at line 17 of file LocatorImpl.cpp.
: publicId_ (publicId ? ACE::strnew (publicId) : 0), systemId_ (systemId ? ACE::strnew (systemId) : 0), lineNumber_ (1), columnNumber_ (0) { }
ACEXML_LocatorImpl::ACEXML_LocatorImpl | ( | const ACEXML_Locator & | locator | ) |
Copy constructor. Create a persistent copy of the current state of a locator. When the original locator changes, this copy will still keep the original values (and it can be used outside the scope of DocumentHandler methods).
Definition at line 27 of file LocatorImpl.cpp.
: publicId_ (locator.getPublicId() ? ACE::strnew(locator.getPublicId ()): 0), systemId_ (locator.getSystemId() ? ACE::strnew(locator.getSystemId ()): 0), lineNumber_ (locator.getLineNumber ()), columnNumber_ (locator.getColumnNumber ()) { }
ACEXML_LocatorImpl::~ACEXML_LocatorImpl | ( | void | ) | [virtual] |
Definition at line 35 of file LocatorImpl.cpp.
{ this->reset(); }
ACEXML_INLINE int ACEXML_LocatorImpl::getColumnNumber | ( | void | ) | const [virtual] |
Implements ACEXML_Locator.
Definition at line 18 of file LocatorImpl.inl.
{ return this->columnNumber_; }
ACEXML_INLINE int ACEXML_LocatorImpl::getLineNumber | ( | void | ) | const [virtual] |
Implements ACEXML_Locator.
Definition at line 24 of file LocatorImpl.inl.
{ return this->lineNumber_; }
ACEXML_INLINE const ACEXML_Char * ACEXML_LocatorImpl::getPublicId | ( | void | ) | const [virtual] |
Implements ACEXML_Locator.
Definition at line 44 of file LocatorImpl.inl.
{ return this->publicId_; }
ACEXML_INLINE const ACEXML_Char * ACEXML_LocatorImpl::getSystemId | ( | void | ) | const [virtual] |
Implements ACEXML_Locator.
Definition at line 50 of file LocatorImpl.inl.
{ return this->systemId_; }
ACEXML_INLINE void ACEXML_LocatorImpl::incrColumnNumber | ( | ) |
Definition at line 62 of file LocatorImpl.inl.
{ ++this->columnNumber_; }
ACEXML_INLINE void ACEXML_LocatorImpl::incrLineNumber | ( | ) |
Definition at line 56 of file LocatorImpl.inl.
{ ++this->lineNumber_; }
void ACEXML_LocatorImpl::reset | ( | void | ) |
Definition at line 41 of file LocatorImpl.cpp.
{ delete[] this->publicId_; this->publicId_ = 0; delete[] this->systemId_; this->systemId_ = 0; this->columnNumber_ = 0; this->lineNumber_ = 1; }
ACEXML_INLINE void ACEXML_LocatorImpl::setColumnNumber | ( | int | cn | ) |
Definition at line 6 of file LocatorImpl.inl.
{ this->columnNumber_ = cn; }
ACEXML_INLINE void ACEXML_LocatorImpl::setLineNumber | ( | int | ln | ) |
Definition at line 12 of file LocatorImpl.inl.
{ this->lineNumber_ = ln; }
ACEXML_INLINE void ACEXML_LocatorImpl::setPublicId | ( | const ACEXML_Char * | id | ) |
Definition at line 30 of file LocatorImpl.inl.
{ delete[] this->publicId_; this->publicId_ = ACE::strnew (id); }
ACEXML_INLINE void ACEXML_LocatorImpl::setSystemId | ( | const ACEXML_Char * | id | ) |
Definition at line 37 of file LocatorImpl.inl.
{ delete[] this->systemId_; this->systemId_ = ACE::strnew (id); }
int ACEXML_LocatorImpl::columnNumber_ [private] |
Definition at line 150 of file LocatorImpl.h.
int ACEXML_LocatorImpl::lineNumber_ [private] |
Definition at line 149 of file LocatorImpl.h.
ACEXML_Char* ACEXML_LocatorImpl::publicId_ [private] |
Definition at line 147 of file LocatorImpl.h.
ACEXML_Char* ACEXML_LocatorImpl::systemId_ [private] |
Definition at line 148 of file LocatorImpl.h.