peiyongz 2002/11/25 10:14:35 Modified: c/src/xercesc/util Base64.cpp Log: Schema Errata: E2-9 Base64 Revision Changes Path 1.6 +47 -6 xml-xerces/c/src/xercesc/util/Base64.cpp Index: Base64.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Base64.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Base64.cpp 4 Nov 2002 15:22:03 -0000 1.5 +++ Base64.cpp 25 Nov 2002 18:14:35 -0000 1.6 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.6 2002/11/25 18:14:35 peiyongz + * Schema Errata: E2-9 Base64 + * * Revision 1.5 2002/11/04 15:22:03 tng * C++ Namespace Support. * @@ -97,8 +100,7 @@ #include <xercesc/util/Base64.hpp> #include <xercesc/util/XMLString.hpp> #include <xercesc/util/Janitor.hpp> -#include <xercesc/util/PlatformUtils.hpp> -#include <xercesc/util/TransService.hpp> +#include <xercesc/internal/XMLReader.hpp> XERCES_CPP_NAMESPACE_BEGIN @@ -135,6 +137,31 @@ bool Base64::isInitialized = false; +/** + * E2-9 + * + * Canonical-base64Binary ::= (B64line* B64lastline)? + * + * B64line ::= B64x15 B64x15 B64x15 B64x15 B64x15 B64 #xA + * 76 Base64 characters followed by newline + * + * B64x15 ::= B64 B64 B64 B64 B64 + * B64 B64 B64 B64 B64 + * B64 B64 B64 B64 B64 + * + * B64lastline ::= B64x4? B64x4? B64x4? B64x4? + * B64x4? B64x4? B64x4? B64x4? + * B64x4? B64x4? B64x4? B64x4? + * B64x4? B64x4? B64x4? B64x4? + * B64x4? B64x4? + * (B64x4 | (B64 B64 B16 '=') | (B64 B04 '==')) + * #xA + * + * B64x4 ::= B64 B64 B64 B64 + * B04 ::= [AQgw] + * B16 ::= [AEIMQUYcgkosw048] +*/ + // number of quadruplets per one line ( must be >1 and <19 ) const unsigned int Base64::quadsPerLine = 15; @@ -269,6 +296,22 @@ // // temporary data, rawInputData, is ALWAYS released by this function. // + +/*** + * E2-9 + * + * Base64Binary ::= S? B64quartet* B64final? + * + * B64quartet ::= B64 S? B64 S? B64 S? B64 S? + * + * B64final ::= B64 S? B04 S? '=' S? '=' S? + * | B64 S? B64 S? B16 S? '=' S? + * + * B04 ::= [AQgw] + * B16 ::= [AEIMQUYcgkosw048] + * B64 ::= [A-Za-z0-9+/] +*/ + XMLByte* Base64::decode(const XMLByte* const inputData, unsigned int* outputLength) { @@ -279,9 +322,8 @@ return 0; // - // remove all whitespaces from the base64Data + // remove all XML whitespaces from the base64Data // - int inputLength = XMLString::stringLen( (const char* const)inputData ); XMLByte* rawInputData = new XMLByte[ inputLength + 1 ]; ArrayJanitor<XMLByte> jan(rawInputData); @@ -290,8 +332,7 @@ int rawInputLength = 0; while ( inputIndex < inputLength ) { -// if( !isspace( inputData[ inputIndex ] )) - if (!XMLPlatformUtils::fgTransService->isSpace(inputData[inputIndex])) + if (!XMLReader::isWhitespace(inputData[inputIndex])) rawInputData[ rawInputLength++ ] = inputData[ inputIndex ]; inputIndex++;
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]