michael@0: /* michael@0: ********************************************************************** michael@0: * Copyright (C) 2005-2008, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: ********************************************************************** michael@0: */ michael@0: michael@0: #ifndef __INPUTEXT_H michael@0: #define __INPUTEXT_H michael@0: michael@0: /** michael@0: * \file michael@0: * \internal michael@0: * michael@0: * This is an internal header for the Character Set Detection code. The michael@0: * name is probably too generic... michael@0: */ michael@0: michael@0: michael@0: #include "unicode/uobject.h" michael@0: michael@0: #if !UCONFIG_NO_CONVERSION michael@0: michael@0: U_NAMESPACE_BEGIN michael@0: michael@0: class InputText : public UMemory michael@0: { michael@0: // Prevent copying michael@0: InputText(const InputText &); michael@0: public: michael@0: InputText(UErrorCode &status); michael@0: ~InputText(); michael@0: michael@0: void setText(const char *in, int32_t len); michael@0: void setDeclaredEncoding(const char *encoding, int32_t len); michael@0: UBool isSet() const; michael@0: void MungeInput(UBool fStripTags); michael@0: michael@0: // The text to be checked. Markup will have been michael@0: // removed if appropriate. michael@0: uint8_t *fInputBytes; michael@0: int32_t fInputLen; // Length of the byte data in fInputBytes. michael@0: // byte frequency statistics for the input text. michael@0: // Value is percent, not absolute. michael@0: // Value is rounded up, so zero really means zero occurences. michael@0: int16_t *fByteStats; michael@0: UBool fC1Bytes; // True if any bytes in the range 0x80 - 0x9F are in the input;false by default michael@0: char *fDeclaredEncoding; michael@0: michael@0: const uint8_t *fRawInput; // Original, untouched input bytes. michael@0: // If user gave us a byte array, this is it. michael@0: // If user gave us a stream, it's read to a michael@0: // buffer here. michael@0: int32_t fRawLength; // Length of data in fRawInput array. michael@0: michael@0: }; michael@0: michael@0: U_NAMESPACE_END michael@0: michael@0: #endif michael@0: #endif /* __INPUTEXT_H */