collationdatawriter.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // © 2016 and later: Unicode, Inc. and others.
  2. // License & terms of use: http://www.unicode.org/copyright.html
  3. /*
  4. *******************************************************************************
  5. * Copyright (C) 2013-2014, International Business Machines
  6. * Corporation and others. All Rights Reserved.
  7. *******************************************************************************
  8. * collationdatawriter.h
  9. *
  10. * created on: 2013aug06
  11. * created by: Markus W. Scherer
  12. */
  13. #ifndef __COLLATIONDATAWRITER_H__
  14. #define __COLLATIONDATAWRITER_H__
  15. #include "unicode/utypes.h"
  16. #if !UCONFIG_NO_COLLATION
  17. U_NAMESPACE_BEGIN
  18. struct CollationData;
  19. struct CollationSettings;
  20. struct CollationTailoring;
  21. /**
  22. * Collation-related code for tools & demos.
  23. */
  24. class U_I18N_API CollationDataWriter /* all static */ {
  25. public:
  26. static int32_t writeBase(const CollationData &data, const CollationSettings &settings,
  27. const void *rootElements, int32_t rootElementsLength,
  28. int32_t indexes[], uint8_t *dest, int32_t capacity,
  29. UErrorCode &errorCode);
  30. static int32_t writeTailoring(const CollationTailoring &t, const CollationSettings &settings,
  31. int32_t indexes[], uint8_t *dest, int32_t capacity,
  32. UErrorCode &errorCode);
  33. private:
  34. CollationDataWriter(); // no constructor
  35. static int32_t write(UBool isBase, const UVersionInfo dataVersion,
  36. const CollationData &data, const CollationSettings &settings,
  37. const void *rootElements, int32_t rootElementsLength,
  38. int32_t indexes[], uint8_t *dest, int32_t capacity,
  39. UErrorCode &errorCode);
  40. static void copyData(const int32_t indexes[], int32_t startIndex,
  41. const void *src, uint8_t *dest);
  42. };
  43. U_NAMESPACE_END
  44. #endif // !UCONFIG_NO_COLLATION
  45. #endif // __COLLATIONDATAWRITER_H__