locbund.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // © 2016 and later: Unicode, Inc. and others.
  2. // License & terms of use: http://www.unicode.org/copyright.html
  3. /*
  4. *******************************************************************************
  5. *
  6. * Copyright (C) 1998-2011, International Business Machines
  7. * Corporation and others. All Rights Reserved.
  8. *
  9. *******************************************************************************
  10. *
  11. * File locbund.h
  12. *
  13. * Modification History:
  14. *
  15. * Date Name Description
  16. * 10/16/98 stephen Creation.
  17. * 02/25/99 stephen Modified for new C API.
  18. *******************************************************************************
  19. */
  20. #ifndef LOCBUND_H
  21. #define LOCBUND_H
  22. #include "unicode/utypes.h"
  23. #if !UCONFIG_NO_FORMATTING
  24. #include "unicode/unum.h"
  25. #define ULOCALEBUNDLE_NUMBERFORMAT_COUNT ((int32_t)UNUM_SPELLOUT)
  26. typedef struct ULocaleBundle {
  27. char *fLocale;
  28. UNumberFormat *fNumberFormat[ULOCALEBUNDLE_NUMBERFORMAT_COUNT];
  29. UBool isInvariantLocale;
  30. } ULocaleBundle;
  31. /**
  32. * Initialize a ULocaleBundle, initializing all formatters to 0.
  33. * @param result A ULocaleBundle to initialize.
  34. * @param loc The locale of the ULocaleBundle.
  35. * @return A pointer to a ULocaleBundle, or 0 if <TT>loc</TT> was invalid.
  36. */
  37. U_CAPI ULocaleBundle *
  38. u_locbund_init(ULocaleBundle *result, const char *loc);
  39. /**
  40. * Create a new ULocaleBundle, initializing all formatters to 0.
  41. * @param loc The locale of the ULocaleBundle.
  42. * @return A pointer to a ULocaleBundle, or 0 if <TT>loc</TT> was invalid.
  43. */
  44. /*U_CAPI ULocaleBundle *
  45. u_locbund_new(const char *loc);*/
  46. /**
  47. * Create a deep copy of this ULocaleBundle;
  48. * @param bundle The ULocaleBundle to clone.
  49. * @return A new ULocaleBundle.
  50. */
  51. /*U_CAPI ULocaleBundle *
  52. u_locbund_clone(const ULocaleBundle *bundle);*/
  53. /**
  54. * Delete the specified ULocaleBundle, freeing all associated memory.
  55. * @param bundle The ULocaleBundle to delete
  56. */
  57. U_CAPI void
  58. u_locbund_close(ULocaleBundle *bundle);
  59. /**
  60. * Get the NumberFormat used to format and parse numbers in a ULocaleBundle.
  61. * @param bundle The ULocaleBundle to use
  62. * @return A pointer to the NumberFormat used for number formatting and parsing.
  63. */
  64. U_CAPI UNumberFormat *
  65. u_locbund_getNumberFormat(ULocaleBundle *bundle, UNumberFormatStyle style);
  66. #endif /* #if !UCONFIG_NO_FORMATTING */
  67. #endif