StreamingTextDecoderMac.h [plain text]
#ifndef StreamingTextDecoderMac_H
#define StreamingTextDecoderMac_H
#include "StreamingTextDecoder.h"
namespace WebCore {
class StreamingTextDecoderMac : public StreamingTextDecoder {
public:
StreamingTextDecoderMac(const TextEncoding&);
virtual ~StreamingTextDecoderMac();
bool textEncodingSupported();
virtual DeprecatedString toUnicode(const char* chs, int len, bool flush = false);
virtual DeprecatedCString fromUnicode(const DeprecatedString&, bool allowEntities = false);
private:
DeprecatedString convert(const char* chs, int len, bool flush)
{ return convert(reinterpret_cast<const unsigned char*>(chs), len, flush); }
DeprecatedString convert(const unsigned char *chs, int len, bool flush);
bool convertIfASCII(const unsigned char*, int len, DeprecatedString&);
DeprecatedString convertUTF16(const unsigned char*, int len);
DeprecatedString convertUsingTEC(const unsigned char*, int len, bool flush);
OSStatus convertOneChunkUsingTEC(const unsigned char *inputBuffer, int inputBufferLength, int &inputLength, void *outputBuffer, int outputBufferLength, int &outputLength);
OSStatus createTECConverter();
void releaseTECConverter();
static void appendOmittingBOM(DeprecatedString&, const UChar* characters, int byteCount);
TextEncoding m_encoding;
bool m_littleEndian;
bool m_atStart;
bool m_error;
unsigned m_numBufferedBytes;
unsigned char m_bufferedBytes[16];
TECObjectRef m_converterTEC;
};
}
#endif // StreamingTextDecoderMac_H