You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/10/21 00:00:38 UTC

cvs commit: xml-xerces/c/samples/DOMCount DOMCount.cpp DOMCount.hpp

andyh       00/10/20 15:00:37

  Modified:    c/samples/DOMCount DOMCount.cpp DOMCount.hpp
  Log:
  DOMCount sample Minor cleanup - rename error handler class to say that it is an error handler.
  
  Revision  Changes    Path
  1.10      +10 -10    xml-xerces/c/samples/DOMCount/DOMCount.cpp
  
  Index: DOMCount.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/DOMCount/DOMCount.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DOMCount.cpp	2000/07/20 18:24:31	1.9
  +++ DOMCount.cpp	2000/10/20 22:00:34	1.10
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: DOMCount.cpp,v 1.9 2000/07/20 18:24:31 aruna1 Exp $
  + * $Id: DOMCount.cpp,v 1.10 2000/10/20 22:00:34 andyh Exp $
    */
   
   // ---------------------------------------------------------------------------
  @@ -179,8 +179,8 @@
       parser.setDoNamespaces(doNamespaces);
   
       // And create our error handler and install it
  -    DOMCount elementCounter;
  -    parser.setErrorHandler(&elementCounter);
  +    DOMCountErrorHandler errorHandler;
  +    parser.setErrorHandler(&errorHandler);
   
       //
       //  Get the starting time and kick off the parse of the indicated
  @@ -221,7 +221,7 @@
       //  Extract the DOM tree, get the list of all the elements and report the
       //  length as the count of elements.
       //
  -    if (elementCounter.getSawErrors())
  +    if (errorHandler.getSawErrors())
       {
           cout << "\nErrors occured, no output available\n" << endl;
       }
  @@ -242,13 +242,13 @@
   }
   
   
  -DOMCount::DOMCount() :
  +DOMCountErrorHandler::DOMCountErrorHandler() :
   
       fSawErrors(false)
   {
   }
   
  -DOMCount::~DOMCount()
  +DOMCountErrorHandler::~DOMCountErrorHandler()
   {
   }
   
  @@ -256,7 +256,7 @@
   // ---------------------------------------------------------------------------
   //  DOMCountHandlers: Overrides of the SAX ErrorHandler interface
   // ---------------------------------------------------------------------------
  -void DOMCount::error(const SAXParseException& e)
  +void DOMCountErrorHandler::error(const SAXParseException& e)
   {
       fSawErrors = true;
       cerr << "\nError at file " << StrX(e.getSystemId())
  @@ -265,7 +265,7 @@
            << "\n  Message: " << StrX(e.getMessage()) << endl;
   }
   
  -void DOMCount::fatalError(const SAXParseException& e)
  +void DOMCountErrorHandler::fatalError(const SAXParseException& e)
   {
       fSawErrors = true;
       cerr << "\nFatal Error at file " << StrX(e.getSystemId())
  @@ -274,7 +274,7 @@
            << "\n  Message: " << StrX(e.getMessage()) << endl;
   }
   
  -void DOMCount::warning(const SAXParseException& e)
  +void DOMCountErrorHandler::warning(const SAXParseException& e)
   {
       cerr << "\nWarning at file " << StrX(e.getSystemId())
            << ", line " << e.getLineNumber()
  @@ -282,6 +282,6 @@
            << "\n  Message: " << StrX(e.getMessage()) << endl;
   }
   
  -void DOMCount::resetErrors()
  +void DOMCountErrorHandler::resetErrors()
   {
   }
  
  
  
  1.5       +11 -6     xml-xerces/c/samples/DOMCount/DOMCount.hpp
  
  Index: DOMCount.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/samples/DOMCount/DOMCount.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DOMCount.hpp	2000/03/02 19:53:39	1.4
  +++ DOMCount.hpp	2000/10/20 22:00:35	1.5
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: DOMCount.hpp,v $
  + * Revision 1.5  2000/10/20 22:00:35  andyh
  + * DOMCount sample Minor cleanup - rename error handler class to say that it is an error handler.
  + *
    * Revision 1.4  2000/03/02 19:53:39  roddey
    * This checkin includes many changes done while waiting for the
    * 1.1.0 code to be finished. I can't list them all here, but a list is
  @@ -87,14 +90,14 @@
   // ---------------------------------------------------------------------------
   //  Simple error handler deriviative to install on parser
   // ---------------------------------------------------------------------------
  -class DOMCount : public ErrorHandler
  +class DOMCountErrorHandler : public ErrorHandler
   {
   public:
       // -----------------------------------------------------------------------
       //  Constructors and Destructor
       // -----------------------------------------------------------------------
  -    DOMCount();
  -    ~DOMCount();
  +    DOMCountErrorHandler();
  +    ~DOMCountErrorHandler();
   
   
       // -----------------------------------------------------------------------
  @@ -116,8 +119,8 @@
       // -----------------------------------------------------------------------
       //  Unimplemented constructors and operators
       // -----------------------------------------------------------------------
  -    DOMCount(const DOMCount&);
  -    void operator=(const DOMCount&);
  +    DOMCountErrorHandler(const DOMCountErrorHandler&);
  +    void operator=(const DOMCountErrorHandler&);
   
   
       // -----------------------------------------------------------------------
  @@ -178,7 +181,7 @@
       return target;
   }
   
  -inline bool DOMCount::getSawErrors() const
  +inline bool DOMCountErrorHandler::getSawErrors() const
   {
       return fSawErrors;
   }