You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ne...@apache.org on 2003/11/24 20:52:07 UTC

cvs commit: xml-xerces/c/src/xercesc/util TransService.cpp TransService.hpp

neilg       2003/11/24 11:52:06

  Modified:    c/src/xercesc/util TransService.cpp TransService.hpp
  Log:
  allow classes derived from XMLTransService to tailor the intrinsic maps to their taste.
  
  Revision  Changes    Path
  1.13      +7 -17     xml-xerces/c/src/xercesc/util/TransService.cpp
  
  Index: TransService.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/TransService.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TransService.cpp	15 May 2003 19:07:45 -0000	1.12
  +++ TransService.cpp	24 Nov 2003 19:52:06 -0000	1.13
  @@ -61,8 +61,6 @@
   //  Includes
   // ---------------------------------------------------------------------------
   #include <xercesc/util/Janitor.hpp>
  -#include <xercesc/util/RefHashTableOf.hpp>
  -#include <xercesc/util/RefVectorOf.hpp>
   #include <xercesc/util/XML88591Transcoder.hpp>
   #include <xercesc/util/XMLASCIITranscoder.hpp>
   #include <xercesc/util/XMLChTranscoder.hpp>
  @@ -74,43 +72,35 @@
   #include <xercesc/util/XMLWin1252Transcoder.hpp>
   #include <xercesc/util/XMLUniDefs.hpp>
   #include <xercesc/util/XMLUni.hpp>
  -#include <xercesc/util/TransENameMap.hpp>
   #include <xercesc/util/EncodingValidator.hpp>
   #include <xercesc/util/XMLRegisterCleanup.hpp>
   #include <xercesc/util/PlatformUtils.hpp>
  +#include <xercesc/util/TransENameMap.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
   
   // ---------------------------------------------------------------------------
   //  Local, static data
   //
  -//  gMappings
  -//      This is a hash table of ENameMap objects. It is created and filled
  -//      in when the platform init calls our initTransService() method.
  -//
  -//  gMappingsRecognizer
  -//      This is an array of ENameMap objects, predefined for those
  -//      already recognized by XMLRecognizer::Encodings.
  -//
   //  gStrictIANAEncoding
   //      A flag to control whether strict IANA encoding names checking should
   //      be done
   //
   // ---------------------------------------------------------------------------
  -static RefHashTableOf<ENameMap>*    gMappings = 0;
  -static RefVectorOf<ENameMap>*       gMappingsRecognizer = 0;
   static bool gStrictIANAEncoding = false;
  +RefHashTableOf<ENameMap>* XMLTransService::gMappings = 0;
  +RefVectorOf<ENameMap> * XMLTransService::gMappingsRecognizer = 0;
   
   // -----------------------------------------------------------------------
   //  Notification that lazy data has been deleted
   // -----------------------------------------------------------------------
  -static void reinitMappings() {
  +void XMLTransService::reinitMappings() {
       delete gMappings;    // The contents of the gMappings hash table are owned by
       gMappings = 0;       //   the it, and so will be deleted by gMapping's destructor.
   }
   
  -static void reinitMappingsRecognizer() {
  -    delete gMappingsRecognizer;
  +void XMLTransService::reinitMappingsRecognizer() {
  +    delete XMLTransService::gMappingsRecognizer;
       gMappingsRecognizer = 0;
   }
   
  
  
  
  1.10      +27 -7     xml-xerces/c/src/xercesc/util/TransService.hpp
  
  Index: TransService.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/TransService.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TransService.hpp	3 Jun 2003 18:12:29 -0000	1.9
  +++ TransService.hpp	24 Nov 2003 19:52:06 -0000	1.10
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.10  2003/11/24 19:52:06  neilg
  + * allow classes derived from XMLTransService to tailor the intrinsic maps to their taste.
  + *
    * Revision 1.9  2003/06/03 18:12:29  knoaman
    * Add default value for memory manager argument.
    *
  @@ -148,6 +151,8 @@
   #include <xercesc/util/XMemory.hpp>
   #include <xercesc/util/PlatformUtils.hpp>
   #include <xercesc/framework/XMLRecognizer.hpp>
  +#include <xercesc/util/RefHashTableOf.hpp>
  +#include <xercesc/util/RefVectorOf.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  @@ -281,6 +286,25 @@
           , MemoryManager* const          manager
       ) = 0;
   
  +    // -----------------------------------------------------------------------
  +    //  Protected init method for platform utils to call
  +    // -----------------------------------------------------------------------
  +    friend class XMLPlatformUtils;
  +    virtual void initTransService();
  +
  +    // -----------------------------------------------------------------------
  +    // protected static members
  +    //  gMappings
  +    //      This is a hash table of ENameMap objects. It is created and filled
  +    //      in when the platform init calls our initTransService() method.
  +    //
  +    //  gMappingsRecognizer
  +    //      This is an array of ENameMap objects, predefined for those
  +    //      already recognized by XMLRecognizer::Encodings.
  +    //
  +
  +    static RefHashTableOf<ENameMap>*    gMappings;
  +    static RefVectorOf<ENameMap>*       gMappingsRecognizer;
   
   private :
       // -----------------------------------------------------------------------
  @@ -295,12 +319,9 @@
       // -----------------------------------------------------------------------
       void strictIANAEncoding(const bool newState);
       bool isStrictIANAEncoding();
  +    static void reinitMappings();
  +    static void reinitMappingsRecognizer();
   
  -    // -----------------------------------------------------------------------
  -    //  Hidden init method for platform utils to call
  -    // -----------------------------------------------------------------------
  -    friend class XMLPlatformUtils;
  -    void initTransService();
   };
   
   
  @@ -473,7 +494,6 @@
       // -----------------------------------------------------------------------
       XMLTranscoder(const XMLTranscoder&);
       XMLTranscoder& operator=(const XMLTranscoder&);
  -
   
       // -----------------------------------------------------------------------
       //  Private data members
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org