remtrans.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // © 2016 and later: Unicode, Inc. and others.
  2. // License & terms of use: http://www.unicode.org/copyright.html
  3. /*
  4. **********************************************************************
  5. * Copyright (c) 2001-2007, International Business Machines
  6. * Corporation and others. All Rights Reserved.
  7. **********************************************************************
  8. * Date Name Description
  9. * 04/02/2001 aliu Creation.
  10. **********************************************************************
  11. */
  12. #ifndef REMTRANS_H
  13. #define REMTRANS_H
  14. #include "unicode/utypes.h"
  15. #if !UCONFIG_NO_TRANSLITERATION
  16. #include "unicode/translit.h"
  17. U_NAMESPACE_BEGIN
  18. /**
  19. * A transliterator that removes text.
  20. * @author Alan Liu
  21. */
  22. class RemoveTransliterator : public Transliterator {
  23. public:
  24. /**
  25. * Constructs a transliterator.
  26. */
  27. RemoveTransliterator();
  28. /**
  29. * Destructor.
  30. */
  31. virtual ~RemoveTransliterator();
  32. /**
  33. * System registration hook.
  34. */
  35. static void registerIDs();
  36. /**
  37. * Transliterator API.
  38. * @return A copy of the object.
  39. */
  40. virtual RemoveTransliterator* clone() const override;
  41. /**
  42. * Implements {@link Transliterator#handleTransliterate}.
  43. * @param text the buffer holding transliterated and
  44. * untransliterated text
  45. * @param offset the start and limit of the text, the position
  46. * of the cursor, and the start and limit of transliteration.
  47. * @param incremental if true, assume more text may be coming after
  48. * pos.contextLimit. Otherwise, assume the text is complete.
  49. */
  50. virtual void handleTransliterate(Replaceable& text, UTransPosition& offset,
  51. UBool isIncremental) const override;
  52. /**
  53. * ICU "poor man's RTTI", returns a UClassID for the actual class.
  54. */
  55. virtual UClassID getDynamicClassID() const override;
  56. /**
  57. * ICU "poor man's RTTI", returns a UClassID for this class.
  58. */
  59. U_I18N_API static UClassID U_EXPORT2 getStaticClassID();
  60. };
  61. U_NAMESPACE_END
  62. #endif /* #if !UCONFIG_NO_TRANSLITERATION */
  63. #endif