tng 2003/01/06 13:48:05 Modified: c/src/xercesc/util/Transcoders/Iconv IconvTransService.cpp IconvTransService.hpp Log: Remove obsolete old functions transcodeXML and transcodeOne Revision Changes Path 1.9 +1 -70 xml-xerces/c/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp Index: IconvTransService.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- IconvTransService.cpp 2 Jan 2003 12:32:18 -0000 1.8 +++ IconvTransService.cpp 6 Jan 2003 21:48:05 -0000 1.9 @@ -499,73 +499,4 @@ { } -// --------------------------------------------------------------------------- -// IconvTranscoder: Constructors and Destructor -// --------------------------------------------------------------------------- -IconvTranscoder::IconvTranscoder(const XMLCh* const encodingName - , const unsigned int blockSize) : - - XMLTranscoder(encodingName, blockSize) -{ -} - -IconvTranscoder::~IconvTranscoder() -{ -} - - -// --------------------------------------------------------------------------- -// IconvTranscoder: Implementation of the virtual transcoder API -// --------------------------------------------------------------------------- -XMLCh IconvTranscoder::transcodeOne(const XMLByte* const srcData - , const unsigned int srcBytes - , unsigned int& bytesEaten) -{ - wchar_t toFill; - int eaten = ::mbtowc(&toFill, (const char*)srcData, srcBytes); - if (eaten == -1) - { - bytesEaten = 0; - return 0; - } - - // Return the bytes we ate and the resulting char. - bytesEaten = eaten; - return toFill; -} - - -unsigned int -IconvTranscoder::transcodeXML( const XMLByte* const srcData - , const unsigned int srcCount - , XMLCh* const toFill - , const unsigned int maxChars - , unsigned int& bytesEaten - , unsigned char* const charSizes) -{ - // - // For this one, because we have to maintain the offset table, we have - // to do them one char at a time until we run out of source data. - // - unsigned int countIn = 0; - unsigned int countOut = 0; - while (countOut < maxChars) - { - wchar_t oneWideChar; - const int bytesEaten = - ::mbtowc(&oneWideChar, (const char*)&srcData[countIn], srcCount - countIn); - - // We are done, so break out - if (bytesEaten == -1) - break; - toFill[countOut] = (XMLCh) oneWideChar; - countIn += (unsigned int) bytesEaten; - countOut++; - } - - // Give back the counts of eaten and transcoded - bytesEaten = countIn; - return countOut; -} - XERCES_CPP_NAMESPACE_END 1.4 +3 -43 xml-xerces/c/src/xercesc/util/Transcoders/Iconv/IconvTransService.hpp Index: IconvTransService.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/Iconv/IconvTransService.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- IconvTransService.hpp 4 Nov 2002 15:14:33 -0000 1.3 +++ IconvTransService.hpp 6 Jan 2003 21:48:05 -0000 1.4 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.4 2003/01/06 21:48:05 tng + * Remove obsolete old functions transcodeXML and transcodeOne + * * Revision 1.3 2002/11/04 15:14:33 tng * C++ Namespace Support. * @@ -161,49 +164,6 @@ IconvTransService(const IconvTransService&); void operator=(const IconvTransService&); }; - - - - -class XMLUTIL_EXPORT IconvTranscoder : public XMLTranscoder -{ -public : - // ----------------------------------------------------------------------- - // Constructors and Destructor - // ----------------------------------------------------------------------- - IconvTranscoder(const XMLCh* const encodingName, const unsigned int blockSize); - ~IconvTranscoder(); - - - // ----------------------------------------------------------------------- - // Implementation of the virtual transcoder interface - // ----------------------------------------------------------------------- - virtual XMLCh transcodeOne - ( - const XMLByte* const srcData - , const unsigned int srcBytes - , unsigned int& bytesEaten - ); - - virtual unsigned int transcodeXML - ( - const XMLByte* const srcData - , const unsigned int srcCount - , XMLCh* const toFill - , const unsigned int maxChars - , unsigned int& bytesEaten - , unsigned char* const charSizes - ); - - -private : - // ----------------------------------------------------------------------- - // Unimplemented constructors and operators - // ----------------------------------------------------------------------- - IconvTranscoder(const IconvTranscoder&); - void operator=(const IconvTranscoder&); -}; - class XMLUTIL_EXPORT IconvLCPTranscoder : public XMLLCPTranscoder
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]