diff --git a/src/internal/XMLReader.cpp b/src/internal/XMLReader.cpp index 68ed505df0fcd2a4e6082317abc5688451828dde..5da66bee957a45b5413d5e362a62faec2c9eaadb 100644 --- a/src/internal/XMLReader.cpp +++ b/src/internal/XMLReader.cpp @@ -56,6 +56,10 @@ /** * $Log$ + * Revision 1.7 2000/01/25 22:49:54 roddey + * Moved the supportsSrcOfs() method from the individual transcoder to the + * transcoding service, where it should have been to begin with. + * * Revision 1.6 2000/01/25 01:04:21 roddey * Fixes a bogus error about ]]> in char data. * @@ -194,6 +198,9 @@ XMLReader::XMLReader(const XMLCh* const pubId // Do an initial load of raw bytes refreshRawBuffer(); + // Ask the transcoding service if it supports src offset info + fSrcOfsSupported = XMLPlatformUtils::fgTransService->supportsSrcOfs(); + // // Use the recognizer class to get a basic sense of what family of // encodings this file is in. We'll start off with a reader of that @@ -269,6 +276,9 @@ XMLReader::XMLReader(const XMLCh* const pubId // Copy the encoding string to our member fEncodingStr = XMLString::replicate(encodingStr); + // Ask the transcoding service if it supports src offset info + fSrcOfsSupported = XMLPlatformUtils::fgTransService->supportsSrcOfs(); + // // Map the passed encoding name to one of our enums. If it does not // match one of the intrinsic encodings, it will come back 'other', @@ -301,9 +311,6 @@ XMLReader::XMLReader(const XMLCh* const pubId ); } - // Ask the transcoder if it supports src offset info - fSrcOfsSupported = fTranscoder->supportsSrcOfs(); - // // Note that, unlike above, we do not do an initial decode of the // first line. We take the caller's word that the encoding is correct @@ -391,9 +398,6 @@ bool XMLReader::refreshCharBuffer() , fEncodingStr ); } - - // Ask the transcoder if it supports src offset info - fSrcOfsSupported = fTranscoder->supportsSrcOfs(); } // @@ -1297,9 +1301,6 @@ bool XMLReader::setEncoding(const XMLCh* const newEncoding) // Update the base encoding member with the new base encoding found fEncoding = newBaseEncoding; - // Ask our new transcoder if it supports src offsets - fSrcOfsSupported = fTranscoder->supportsSrcOfs(); - // Looks ok to us return true; } diff --git a/src/util/TransService.hpp b/src/util/TransService.hpp index 0b775da839a7d3db2a6fc8e976eaff1bb12d110d..6be26d23e7436adebaa2f1ab35d8c6076281e50c 100644 --- a/src/util/TransService.hpp +++ b/src/util/TransService.hpp @@ -56,6 +56,10 @@ /** * $Log$ + * Revision 1.5 2000/01/25 22:49:55 roddey + * Moved the supportsSrcOfs() method from the individual transcoder to the + * transcoding service, where it should have been to begin with. + * * Revision 1.4 2000/01/25 19:19:07 roddey * Simple addition of a getId() method to the xcode and netacess abstractions to * allow each impl to give back an id string. @@ -153,6 +157,8 @@ public : virtual XMLLCPTranscoder* makeNewLCPTranscoder() = 0; + virtual bool supportsSrcOfs() const = 0; + virtual void upperCase(XMLCh* const toUpperCase) const = 0; @@ -221,8 +227,6 @@ public : // ----------------------------------------------------------------------- // The virtual transcoding interface // ----------------------------------------------------------------------- - virtual bool supportsSrcOfs() const = 0; - virtual XMLCh transcodeOne ( const XMLByte* const srcData diff --git a/src/util/Transcoders/ICU/ICUTransService.cpp b/src/util/Transcoders/ICU/ICUTransService.cpp index 5e22d7591a588be1ccf32eadbf16578c4fd68e72..c4da4b6a461c48eecdfcbab313e197b2b45aa92e 100644 --- a/src/util/Transcoders/ICU/ICUTransService.cpp +++ b/src/util/Transcoders/ICU/ICUTransService.cpp @@ -56,6 +56,10 @@ /** * $Log$ + * Revision 1.12 2000/01/25 22:49:56 roddey + * Moved the supportsSrcOfs() method from the individual transcoder to the + * transcoding service, where it should have been to begin with. + * * Revision 1.11 2000/01/25 19:19:07 roddey * Simple addition of a getId() method to the xcode and netacess abstractions to * allow each impl to give back an id string. @@ -289,6 +293,13 @@ XMLLCPTranscoder* ICUTransService::makeNewLCPTranscoder() } +bool ICUTransService::supportsSrcOfs() const +{ + // This implementation supports source offset information + return true; +} + + void ICUTransService::upperCase(XMLCh* const toUpperCase) const { XMLCh* outPtr = toUpperCase; @@ -378,13 +389,6 @@ ICUTranscoder::~ICUTranscoder() // --------------------------------------------------------------------------- // ICUTranscoder: The virtual transcoder API // --------------------------------------------------------------------------- -bool ICUTranscoder::supportsSrcOfs() const -{ - // This implementation supports source offset information - return true; -} - - XMLCh ICUTranscoder::transcodeOne( const XMLByte* const srcData , const unsigned int srcBytes , unsigned int& bytesEaten) diff --git a/src/util/Transcoders/ICU/ICUTransService.hpp b/src/util/Transcoders/ICU/ICUTransService.hpp index 8e06e545849a4d4d226f4256d50997b2ef3bdad0..522c87e3262ead86a73dde8a0b52e378e3b5cc3a 100644 --- a/src/util/Transcoders/ICU/ICUTransService.hpp +++ b/src/util/Transcoders/ICU/ICUTransService.hpp @@ -56,6 +56,10 @@ /** * $Log$ + * Revision 1.7 2000/01/25 22:49:56 roddey + * Moved the supportsSrcOfs() method from the individual transcoder to the + * transcoding service, where it should have been to begin with. + * * Revision 1.6 2000/01/25 19:19:08 roddey * Simple addition of a getId() method to the xcode and netacess abstractions to * allow each impl to give back an id string. @@ -121,6 +125,8 @@ public : virtual XMLLCPTranscoder* makeNewLCPTranscoder(); + virtual bool supportsSrcOfs() const; + virtual void upperCase(XMLCh* const toUpperCase) const; @@ -164,8 +170,6 @@ public : // ----------------------------------------------------------------------- // Implementation of the virtual transcoder interface // ----------------------------------------------------------------------- - virtual bool supportsSrcOfs() const; - virtual XMLCh transcodeOne ( const XMLByte* const srcData diff --git a/src/util/Transcoders/Iconv/IconvTransService.cpp b/src/util/Transcoders/Iconv/IconvTransService.cpp index c2c6ea8e822ff5ad8ae0c9258e53e931beac8309..9a85f0f25f0c0f932ea608caabf56d8d1f77abca 100644 --- a/src/util/Transcoders/Iconv/IconvTransService.cpp +++ b/src/util/Transcoders/Iconv/IconvTransService.cpp @@ -56,6 +56,10 @@ /** * $Log$ + * Revision 1.11 2000/01/25 22:49:57 roddey + * Moved the supportsSrcOfs() method from the individual transcoder to the + * transcoding service, where it should have been to begin with. + * * Revision 1.10 2000/01/25 20:56:51 abagchi * Now at least compiles * @@ -226,6 +230,11 @@ XMLLCPTranscoder* IconvTransService::makeNewLCPTranscoder() return new IconvLCPTranscoder; } +bool IconvTransService::supportsSrcOfs() const +{ + return true; +} + // --------------------------------------------------------------------------- // IconvTransService: The protected virtual transcoding service API @@ -252,6 +261,8 @@ void IconvTransService::upperCase(XMLCh* const toUpperCase) const towupper(*toUpperCase); } + + // --------------------------------------------------------------------------- // IconvLCPTranscoder: The virtual transcoder API // --------------------------------------------------------------------------- @@ -485,8 +496,10 @@ IconvLCPTranscoder::~IconvLCPTranscoder() // --------------------------------------------------------------------------- // IconvTranscoder: Constructors and Destructor // --------------------------------------------------------------------------- -IconvTranscoder::IconvTranscoder(const XMLCh* const encodingName, const unsigned int blockSize) -: XMLTranscoder(encodingName, blockSize) +IconvTranscoder::IconvTranscoder(const XMLCh* const encodingName + , const unsigned int blockSize) : + + XMLTranscoder(encodingName, blockSize) { } @@ -498,7 +511,7 @@ IconvTranscoder::~IconvTranscoder() // --------------------------------------------------------------------------- // IconvTranscoder: Implementation of the virtual transcoder API // --------------------------------------------------------------------------- -XMLCh IconvTranscoder::transcodeOne(const XMLByte* const srcData +XMLCh IconvTranscoder::transcodeOne(const XMLByte* const srcData , const unsigned int srcBytes , unsigned int& bytesEaten) { @@ -517,7 +530,7 @@ XMLCh IconvTranscoder::transcodeOne(const XMLByte* const srcData unsigned int -IconvTranscoder::transcodeXML( const XMLByte* const srcData +IconvTranscoder::transcodeXML( const XMLByte* const srcData , const unsigned int srcCount , XMLCh* const toFill , const unsigned int maxChars diff --git a/src/util/Transcoders/Iconv/IconvTransService.hpp b/src/util/Transcoders/Iconv/IconvTransService.hpp index 9ee1aa9518e92ab3a1316fb83a2a42c23784f8c1..f514c087240e494a63349350880de601c56bed89 100644 --- a/src/util/Transcoders/Iconv/IconvTransService.hpp +++ b/src/util/Transcoders/Iconv/IconvTransService.hpp @@ -56,6 +56,10 @@ /** * $Log$ + * Revision 1.6 2000/01/25 22:49:57 roddey + * Moved the supportsSrcOfs() method from the individual transcoder to the + * transcoding service, where it should have been to begin with. + * * Revision 1.5 2000/01/25 19:19:08 roddey * Simple addition of a getId() method to the xcode and netacess abstractions to * allow each impl to give back an id string. @@ -114,6 +118,8 @@ public : virtual XMLLCPTranscoder* makeNewLCPTranscoder(); + virtual bool supportsSrcOfs() const; + virtual void upperCase(XMLCh* const toUpperCase) const; protected : diff --git a/src/util/Transcoders/Win32/Win32TransService.cpp b/src/util/Transcoders/Win32/Win32TransService.cpp index 89333ebc3c367620109dd68b2e8d98d07412ca1c..4f4faab456b4c3f77a81618e61aae3e8c2829f71 100644 --- a/src/util/Transcoders/Win32/Win32TransService.cpp +++ b/src/util/Transcoders/Win32/Win32TransService.cpp @@ -56,6 +56,10 @@ /** * $Log$ + * Revision 1.6 2000/01/25 22:49:58 roddey + * Moved the supportsSrcOfs() method from the individual transcoder to the + * transcoding service, where it should have been to begin with. + * * Revision 1.5 2000/01/25 19:19:09 roddey * Simple addition of a getId() method to the xcode and netacess abstractions to * allow each impl to give back an id string. @@ -149,6 +153,12 @@ XMLLCPTranscoder* Win32TransService::makeNewLCPTranscoder() } +bool Win32TransService::supportsSrcOfs() const +{ + return false; +} + + void Win32TransService::upperCase(XMLCh* const toUpperCase) const { wcsupr(toUpperCase); @@ -195,13 +205,6 @@ Win32Transcoder::~Win32Transcoder() // Win32Transcoder: The virtual transcoder API // --------------------------------------------------------------------------- -// This will never get called because objects of this type are never created -bool Win32Transcoder::supportsSrcOfs() const -{ - return false; -} - - // This will never get called because objects of this type are never created XMLCh Win32Transcoder::transcodeOne(const XMLByte* const , const unsigned int diff --git a/src/util/Transcoders/Win32/Win32TransService.hpp b/src/util/Transcoders/Win32/Win32TransService.hpp index 56498b9c64e6f025e40e5acd1b8aad94ed920d99..d2161a81d86757b7a988c35b8e472e53beb8b5ef 100644 --- a/src/util/Transcoders/Win32/Win32TransService.hpp +++ b/src/util/Transcoders/Win32/Win32TransService.hpp @@ -56,6 +56,10 @@ /** * $Log$ + * Revision 1.5 2000/01/25 22:49:58 roddey + * Moved the supportsSrcOfs() method from the individual transcoder to the + * transcoding service, where it should have been to begin with. + * * Revision 1.4 2000/01/25 19:19:09 roddey * Simple addition of a getId() method to the xcode and netacess abstractions to * allow each impl to give back an id string. @@ -112,6 +116,8 @@ public : virtual XMLLCPTranscoder* makeNewLCPTranscoder(); + virtual bool supportsSrcOfs() const; + virtual void upperCase(XMLCh* const toUpperCase) const; @@ -150,8 +156,6 @@ public : // ----------------------------------------------------------------------- // Implementation of the virtual transcoder interface // ----------------------------------------------------------------------- - virtual bool supportsSrcOfs() const; - virtual XMLCh transcodeOne ( const XMLByte* const srcData