inputext.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // © 2016 and later: Unicode, Inc. and others.
  2. // License & terms of use: http://www.unicode.org/copyright.html
  3. /*
  4. **********************************************************************
  5. * Copyright (C) 2005-2008, International Business Machines
  6. * Corporation and others. All Rights Reserved.
  7. **********************************************************************
  8. */
  9. #ifndef __INPUTEXT_H
  10. #define __INPUTEXT_H
  11. /**
  12. * \file
  13. * \internal
  14. *
  15. * This is an internal header for the Character Set Detection code. The
  16. * name is probably too generic...
  17. */
  18. #include "unicode/uobject.h"
  19. #if !UCONFIG_NO_CONVERSION
  20. U_NAMESPACE_BEGIN
  21. class InputText : public UMemory
  22. {
  23. // Prevent copying
  24. InputText(const InputText &);
  25. public:
  26. InputText(UErrorCode &status);
  27. ~InputText();
  28. void setText(const char *in, int32_t len);
  29. void setDeclaredEncoding(const char *encoding, int32_t len);
  30. UBool isSet() const;
  31. void MungeInput(UBool fStripTags);
  32. // The text to be checked. Markup will have been
  33. // removed if appropriate.
  34. uint8_t *fInputBytes;
  35. int32_t fInputLen; // Length of the byte data in fInputBytes.
  36. // byte frequency statistics for the input text.
  37. // Value is percent, not absolute.
  38. // Value is rounded up, so zero really means zero occurences.
  39. int16_t *fByteStats;
  40. UBool fC1Bytes; // True if any bytes in the range 0x80 - 0x9F are in the input;false by default
  41. char *fDeclaredEncoding;
  42. const uint8_t *fRawInput; // Original, untouched input bytes.
  43. // If user gave us a byte array, this is it.
  44. // If user gave us a stream, it's read to a
  45. // buffer here.
  46. int32_t fRawLength; // Length of data in fRawInput array.
  47. };
  48. U_NAMESPACE_END
  49. #endif
  50. #endif /* __INPUTEXT_H */