Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACEXML_LocatorImpl Class Reference

ACEXML_LocatorImpl is an implementation of ACEXML_Locator. More...

#include "ACEXML/common/LocatorImpl.h"

Inheritance diagram for ACEXML_LocatorImpl:

Inheritance graph
[legend]
Collaboration diagram for ACEXML_LocatorImpl:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACEXML_LocatorImpl (void)
 ACEXML_LocatorImpl (const ACEXML_Locator &locator)
virtual ~ACEXML_LocatorImpl (void)
virtual int getColumnNumber (void) const
virtual int getLineNumber (void) const
virtual const ACEXML_ChargetPublicId (void) const
virtual const ACEXML_ChargetSystemId (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_CharpublicId_
ACEXML_CharsystemId_
int lineNumber_
int columnNumber_

Detailed Description

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.

Todo:
ACEXML parser doesn't support the use of Locator yet.

See also:
ACEXML_Locator

Definition at line 61 of file LocatorImpl.h.


Constructor & Destructor Documentation

ACEXML_LocatorImpl::ACEXML_LocatorImpl void   
 

Definition at line 9 of file LocatorImpl.cpp.

00010   : publicId_ (0),
00011     systemId_ (0),
00012     lineNumber_ (1),
00013     columnNumber_ (0)
00014 {
00015 }

ACEXML_LocatorImpl::ACEXML_LocatorImpl const ACEXML_Locator   locator
 

Definition at line 17 of file LocatorImpl.cpp.

00018   : publicId_ (ACE::strnew (locator.getPublicId ())),
00019     systemId_ (ACE::strnew (locator.getSystemId ())),
00020     lineNumber_ (locator.getLineNumber ()),
00021     columnNumber_ (locator.getColumnNumber ())
00022 {
00023 }

ACEXML_LocatorImpl::~ACEXML_LocatorImpl void    [virtual]
 

Definition at line 25 of file LocatorImpl.cpp.

00026 {
00027 
00028 }


Member Function Documentation

ACEXML_INLINE int ACEXML_LocatorImpl::getColumnNumber void    const [virtual]
 

Implements ACEXML_Locator.

Definition at line 18 of file LocatorImpl.i.

References columnNumber_.

00019 {
00020   return this->columnNumber_;
00021 }

ACEXML_INLINE int ACEXML_LocatorImpl::getLineNumber void    const [virtual]
 

Implements ACEXML_Locator.

Definition at line 24 of file LocatorImpl.i.

References lineNumber_.

00025 {
00026   return this->lineNumber_;
00027 }

ACEXML_INLINE const ACEXML_Char * ACEXML_LocatorImpl::getPublicId void    const [virtual]
 

Implements ACEXML_Locator.

Definition at line 44 of file LocatorImpl.i.

References publicId_.

00045 {
00046   return this->publicId_;
00047 }

ACEXML_INLINE const ACEXML_Char * ACEXML_LocatorImpl::getSystemId void    const [virtual]
 

Implements ACEXML_Locator.

Definition at line 50 of file LocatorImpl.i.

References systemId_.

00051 {
00052   return this->systemId_;
00053 }

ACEXML_INLINE void ACEXML_LocatorImpl::incrColumnNumber  
 

Definition at line 62 of file LocatorImpl.i.

References columnNumber_.

Referenced by ACEXML_Parser::get.

00063 {
00064   ++this->columnNumber_;
00065 }

ACEXML_INLINE void ACEXML_LocatorImpl::incrLineNumber  
 

Definition at line 56 of file LocatorImpl.i.

References lineNumber_.

Referenced by ACEXML_Parser::get.

00057 {
00058   ++this->lineNumber_;
00059 }

void ACEXML_LocatorImpl::reset void   
 

Definition at line 31 of file LocatorImpl.cpp.

References columnNumber_, lineNumber_, publicId_, and systemId_.

00032 {
00033   delete[] this->publicId_;
00034   delete[] this->systemId_;
00035   this->columnNumber_ = 0;
00036   this->lineNumber_ = 1;
00037 }

ACEXML_INLINE void ACEXML_LocatorImpl::setColumnNumber int    cn
 

Definition at line 6 of file LocatorImpl.i.

References columnNumber_.

Referenced by ACEXML_Parser::get.

00007 {
00008   this->columnNumber_ = cn;
00009 }

ACEXML_INLINE void ACEXML_LocatorImpl::setLineNumber int    ln
 

Definition at line 12 of file LocatorImpl.i.

References lineNumber_.

00013 {
00014   this->lineNumber_ = ln;
00015 }

ACEXML_INLINE void ACEXML_LocatorImpl::setPublicId const ACEXML_Char   id
 

Definition at line 30 of file LocatorImpl.i.

References ACEXML_Char, publicId_, and ACE::strnew.

00031 {
00032   delete[] this->publicId_;
00033   this->publicId_ = ACE::strnew (id);
00034 }

ACEXML_INLINE void ACEXML_LocatorImpl::setSystemId const ACEXML_Char   id
 

Definition at line 37 of file LocatorImpl.i.

References ACEXML_Char, ACE::strnew, and systemId_.

00038 {
00039   delete[] this->systemId_;
00040   this->systemId_ = ACE::strnew (id);
00041 }


Member Data Documentation

int ACEXML_LocatorImpl::columnNumber_ [private]
 

Definition at line 144 of file LocatorImpl.h.

Referenced by getColumnNumber, incrColumnNumber, reset, and setColumnNumber.

int ACEXML_LocatorImpl::lineNumber_ [private]
 

Definition at line 143 of file LocatorImpl.h.

Referenced by getLineNumber, incrLineNumber, reset, and setLineNumber.

ACEXML_Char* ACEXML_LocatorImpl::publicId_ [private]
 

Definition at line 141 of file LocatorImpl.h.

Referenced by getPublicId, reset, and setPublicId.

ACEXML_Char* ACEXML_LocatorImpl::systemId_ [private]
 

Definition at line 142 of file LocatorImpl.h.

Referenced by getSystemId, reset, and setSystemId.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 13:27:11 2003 for ACEXML by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002