diff --git a/src/util/TransService.hpp b/src/util/TransService.hpp index 593e91551797ed74f97dd47accba1c2ed86602e7..0b775da839a7d3db2a6fc8e976eaff1bb12d110d 100644 --- a/src/util/TransService.hpp +++ b/src/util/TransService.hpp @@ -56,6 +56,10 @@ /** * $Log$ + * 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. + * * Revision 1.3 1999/12/18 00:18:10 roddey * More changes to support the new, completely orthagonal support for * intrinsic encodings. @@ -143,6 +147,8 @@ public : , const unsigned int maxChars ) = 0; + virtual const XMLCh* getId() const = 0; + virtual bool isSpace(const XMLCh toCheck) const = 0; virtual XMLLCPTranscoder* makeNewLCPTranscoder() = 0; diff --git a/src/util/Transcoders/ICU/ICUTransService.cpp b/src/util/Transcoders/ICU/ICUTransService.cpp index dd45f8f287a8cef7c1315c53398019280bd6d1e5..5e22d7591a588be1ccf32eadbf16578c4fd68e72 100644 --- a/src/util/Transcoders/ICU/ICUTransService.cpp +++ b/src/util/Transcoders/ICU/ICUTransService.cpp @@ -56,6 +56,10 @@ /** * $Log$ + * 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. + * * Revision 1.10 2000/01/24 20:39:47 roddey * Fixed a bug introduced in the recent move to always have XMLCh be * the same as wchar_t. @@ -111,6 +115,16 @@ +// --------------------------------------------------------------------------- +// Local, const data +// --------------------------------------------------------------------------- +static const XMLCh gMyServiceId[] = +{ + chLatin_I, chLatin_C, chLatin_U, chNull +}; + + + // --------------------------------------------------------------------------- // Local functions // --------------------------------------------------------------------------- @@ -234,6 +248,12 @@ int ICUTransService::compareNIString(const XMLCh* const comp1 } +const XMLCh* ICUTransService::getId() const +{ + return gMyServiceId; +} + + bool ICUTransService::isSpace(const XMLCh toCheck) const { // diff --git a/src/util/Transcoders/ICU/ICUTransService.hpp b/src/util/Transcoders/ICU/ICUTransService.hpp index b5972291c22238c96c6483c92ff8b4a336299a3a..8e06e545849a4d4d226f4256d50997b2ef3bdad0 100644 --- a/src/util/Transcoders/ICU/ICUTransService.hpp +++ b/src/util/Transcoders/ICU/ICUTransService.hpp @@ -56,6 +56,10 @@ /** * $Log$ + * 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. + * * Revision 1.5 2000/01/19 23:21:11 abagchi * Made this file compatible with ICU 1.4 * @@ -111,6 +115,8 @@ public : , const unsigned int maxChars ); + virtual const XMLCh* getId() const; + virtual bool isSpace(const XMLCh toCheck) const; virtual XMLLCPTranscoder* makeNewLCPTranscoder(); diff --git a/src/util/Transcoders/Iconv/IconvTransService.cpp b/src/util/Transcoders/Iconv/IconvTransService.cpp index 2e74c9c5554e46409e684993fa2358293cfda820..e4dc493d606813c78141598db3228a23c638d72a 100644 --- a/src/util/Transcoders/Iconv/IconvTransService.cpp +++ b/src/util/Transcoders/Iconv/IconvTransService.cpp @@ -56,6 +56,10 @@ /** * $Log$ + * Revision 1.9 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. + * * Revision 1.8 2000/01/06 01:21:34 aruna1 * Transcoding services modified. * @@ -101,6 +105,7 @@ // --------------------------------------------------------------------------- // Includes // --------------------------------------------------------------------------- +#include <util/XMLUni.hpp> #include "IconvTransService.hpp" #include <wchar.h> #if defined (XML_GNUG) @@ -110,8 +115,21 @@ #include <stdlib.h> #include <stdio.h> -static const int gTempBuffArraySize = 1024; -static unsigned int getWideCharLength(const XMLCh* const src) + +// --------------------------------------------------------------------------- +// Local, const data +// --------------------------------------------------------------------------- +static const int gTempBuffArraySize = 1024; +static const XMLCh gMyServiceId[] = +{ + chLatin_I, chLatin_C, chLatin_o, chDigit_n, chDigit_v, chNull +}; + + +// --------------------------------------------------------------------------- +// Local methods +// --------------------------------------------------------------------------- +static unsigned int getWideCharLength(const XMLCh* const src) { if (!src) return 0; @@ -125,7 +143,6 @@ static unsigned int getWideCharLength(const XMLCh* const src) - // --------------------------------------------------------------------------- // IconvTransService: Constructors and Destructor // --------------------------------------------------------------------------- @@ -188,6 +205,12 @@ int IconvTransService::compareNIString( const XMLCh* const comp1 } +const XMLCh* Iconv32TransService::getId() const +{ + return gMyServiceId; +} + + bool IconvTransService::isSpace(const XMLCh toCheck) const { return (iswspace(toCheck) != 0); @@ -272,7 +295,6 @@ unsigned int IconvLCPTranscoder::calcRequiredSize(const XMLCh* const srcText) } - char* IconvLCPTranscoder::transcode(const XMLCh* const toTranscode) { if (!toTranscode) diff --git a/src/util/Transcoders/Iconv/IconvTransService.hpp b/src/util/Transcoders/Iconv/IconvTransService.hpp index a848257c454d32449c279a22e165fb4945047cfc..9ee1aa9518e92ab3a1316fb83a2a42c23784f8c1 100644 --- a/src/util/Transcoders/Iconv/IconvTransService.hpp +++ b/src/util/Transcoders/Iconv/IconvTransService.hpp @@ -56,6 +56,10 @@ /** * $Log$ + * 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. + * * Revision 1.4 2000/01/06 01:21:34 aruna1 * Transcoding services modified. * @@ -104,6 +108,8 @@ public : , const unsigned int maxChars ); + virtual const XMLCh* getId() const; + virtual bool isSpace(const XMLCh toCheck) const; virtual XMLLCPTranscoder* makeNewLCPTranscoder(); diff --git a/src/util/Transcoders/Win32/Win32TransService.cpp b/src/util/Transcoders/Win32/Win32TransService.cpp index d6409651f6ce8fbc619e4b4f91f15fbfafda2ef5..89333ebc3c367620109dd68b2e8d98d07412ca1c 100644 --- a/src/util/Transcoders/Win32/Win32TransService.cpp +++ b/src/util/Transcoders/Win32/Win32TransService.cpp @@ -56,6 +56,10 @@ /** * $Log$ + * 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. + * * Revision 1.4 1999/12/18 00:22:33 roddey * Changes to support the new, completely orthagonal, transcoder architecture. * @@ -82,9 +86,20 @@ // Includes // --------------------------------------------------------------------------- #include "Win32TransService.hpp" +#include <util/XMLUni.hpp> #include <windows.h> +// --------------------------------------------------------------------------- +// Local, const data +// --------------------------------------------------------------------------- +static const XMLCh gMyServiceId[] = +{ + chLatin_W, chLatin_i, chLatin_n, chDigit_3, chDigit_2, chNull +}; + + + // --------------------------------------------------------------------------- // Win32TransService: Constructors and Destructor // --------------------------------------------------------------------------- @@ -106,6 +121,7 @@ int Win32TransService::compareIString( const XMLCh* const comp1 return _wcsicmp(comp1, comp2); } + int Win32TransService::compareNIString( const XMLCh* const comp1 , const XMLCh* const comp2 , const unsigned int maxChars) @@ -113,11 +129,19 @@ int Win32TransService::compareNIString( const XMLCh* const comp1 return _wcsnicmp(comp1, comp2, maxChars); } + +const XMLCh* Win32TransService::getId() const +{ + return gMyServiceId; +} + + bool Win32TransService::isSpace(const XMLCh toCheck) const { return (iswspace(toCheck) != 0); } + XMLLCPTranscoder* Win32TransService::makeNewLCPTranscoder() { // Just allocate a new LCP transcoder of our type diff --git a/src/util/Transcoders/Win32/Win32TransService.hpp b/src/util/Transcoders/Win32/Win32TransService.hpp index f304229a470e35eca091cd654d7bbd9a780f3009..56498b9c64e6f025e40e5acd1b8aad94ed920d99 100644 --- a/src/util/Transcoders/Win32/Win32TransService.hpp +++ b/src/util/Transcoders/Win32/Win32TransService.hpp @@ -56,6 +56,10 @@ /** * $Log$ + * 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. + * * Revision 1.3 1999/12/18 00:22:33 roddey * Changes to support the new, completely orthagonal, transcoder architecture. * @@ -102,6 +106,8 @@ public : , const unsigned int maxChars ); + virtual const XMLCh* getId() const; + virtual bool isSpace(const XMLCh toCheck) const; virtual XMLLCPTranscoder* makeNewLCPTranscoder(); diff --git a/src/util/XMLNetAccessor.hpp b/src/util/XMLNetAccessor.hpp index daa267cfeed83addfa68331d050fefbbd9740fda..1f29da08101aac665b96c197aff815cf551062df 100644 --- a/src/util/XMLNetAccessor.hpp +++ b/src/util/XMLNetAccessor.hpp @@ -56,6 +56,10 @@ /** * $Log$ + * Revision 1.5 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. + * * Revision 1.4 2000/01/15 01:26:17 rahulj * Added support for HTTP to the parser using libWWW 5.2.8. * Renamed URL.[ch]pp to XMLURL.[ch]pp and like wise for the class name. @@ -131,6 +135,8 @@ public : // ----------------------------------------------------------------------- // The virtual net accessor interface // ----------------------------------------------------------------------- + virtual const XMLCh* getId() const = 0; + virtual BinInputStream* makeNew ( const XMLURL& urlSrc