DOMString is the generic string class that stores all strings used in the DOM C++ API.
More...

Public Types | |
| enum | UnRepOpts { UnRep_Throw, UnRep_RepChar } |
This enum is used by the transcodeTo() method to indicate how to react to unrepresentable characters. More... | |
Public Member Functions | |
Destructor. | |
| virtual | ~XMLTranscoder () |
| Destructor for XMLTranscoder. | |
The virtual transcoding interface | |
| virtual unsigned int | transcodeFrom (const XMLByte *const srcData, const unsigned int srcCount, XMLCh *const toFill, const unsigned int maxChars, unsigned int &bytesEaten, unsigned char *const charSizes)=0 |
| Converts from the encoding of the service to the internal XMLCh* encoding. | |
| virtual unsigned int | transcodeTo (const XMLCh *const srcData, const unsigned int srcCount, XMLByte *const toFill, const unsigned int maxBytes, unsigned int &charsEaten, const UnRepOpts options)=0 |
| Converts from the internal XMLCh* encoding to the encoding of the service. | |
| virtual bool | canTranscodeTo (const unsigned int toCheck) const =0 |
| Query whether the transcoder can handle a given character. | |
Getter methods | |
| unsigned int | getBlockSize () const |
| Get the internal block size. | |
| const XMLCh * | getEncodingName () const |
| Get the encoding name. | |
Getter methods | |
| MemoryManager * | getMemoryManager () const |
| Get the plugged-in memory manager. | |
Protected Member Functions | |
| XMLTranscoder (const XMLCh *const encodingName, const unsigned int blockSize, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager) | |
| void | checkBlockSize (const unsigned int toCheck) |
DOMString is the generic string class that stores all strings used in the DOM C++ API.
Though this class supports most of the common string operations to manipulate strings, it is not meant to be a comphrehensive string class. XMLTranscoder is for transcoding non-local code page encodings, i.e. named encodings. These are used internally by the scanner to internalize raw XML into the internal Unicode format, and by writer classes to convert that internal Unicode format (which comes out of the parser) back out to a format that the receiving client code wants to use.
This enum is used by the transcodeTo() method to indicate how to react to unrepresentable characters.
The transcodeFrom() method always works the same. It will consider any invalid data to be an error and throw.
| virtual XMLTranscoder::~XMLTranscoder | ( | ) | [virtual] |
Destructor for XMLTranscoder.
| XMLTranscoder::XMLTranscoder | ( | const XMLCh *const | encodingName, | |
| const unsigned int | blockSize, | |||
| MemoryManager *const | manager = XMLPlatformUtils::fgMemoryManager | |||
| ) | [protected] |
| virtual unsigned int XMLTranscoder::transcodeFrom | ( | const XMLByte *const | srcData, | |
| const unsigned int | srcCount, | |||
| XMLCh *const | toFill, | |||
| const unsigned int | maxChars, | |||
| unsigned int & | bytesEaten, | |||
| unsigned char *const | charSizes | |||
| ) | [pure virtual] |
Converts from the encoding of the service to the internal XMLCh* encoding.
| srcData | the source buffer to be transcoded | |
| srcCount | number of bytes in the source buffer | |
| toFill | the destination buffer | |
| maxChars | the max number of characters in the destination buffer | |
| bytesEaten | after transcoding, this will hold the number of bytes that were processed from the source buffer | |
| charSizes | an array which must be at least as big as maxChars into which will be inserted values that indicate how many bytes from the input went into each XMLCh that was created into toFill. Since many encodings use variable numbers of byte per character, this provides a means to find out what bytes in the input went into making a particular output UTF-16 character. |
| virtual unsigned int XMLTranscoder::transcodeTo | ( | const XMLCh *const | srcData, | |
| const unsigned int | srcCount, | |||
| XMLByte *const | toFill, | |||
| const unsigned int | maxBytes, | |||
| unsigned int & | charsEaten, | |||
| const UnRepOpts | options | |||
| ) | [pure virtual] |
Converts from the internal XMLCh* encoding to the encoding of the service.
| srcData | the source buffer to be transcoded | |
| srcCount | number of characters in the source buffer | |
| toFill | the destination buffer | |
| maxBytes | the max number of bytes in the destination buffer | |
| charsEaten | after transcoding, this will hold the number of chars that were processed from the source buffer | |
| options | options to pass to the transcoder that explain how to respond to an unrepresentable character |
| virtual bool XMLTranscoder::canTranscodeTo | ( | const unsigned int | toCheck | ) | const [pure virtual] |
Query whether the transcoder can handle a given character.
| toCheck | the character code point to check |
| unsigned int XMLTranscoder::getBlockSize | ( | ) | const |
Get the internal block size.
| const XMLCh * XMLTranscoder::getEncodingName | ( | ) | const |
| MemoryManager * XMLTranscoder::getMemoryManager | ( | ) | const |
Get the plugged-in memory manager.
This method returns the plugged-in memory manager user for dynamic memory allocation/deallocation.
| void XMLTranscoder::checkBlockSize | ( | const unsigned int | toCheck | ) | [protected] |
1.5.4