ICU 4.8.1.1  4.8.1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
unum.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (C) 1997-2011, International Business Machines Corporation and others.
4 * All Rights Reserved.
5 * Modification History:
6 *
7 * Date Name Description
8 * 06/24/99 helena Integrated Alan's NF enhancements and Java2 bug fixes
9 *******************************************************************************
10 */
11 
12 #ifndef _UNUM
13 #define _UNUM
14 
15 #include "unicode/utypes.h"
16 
17 #if !UCONFIG_NO_FORMATTING
18 
19 #include "unicode/localpointer.h"
20 #include "unicode/uloc.h"
21 #include "unicode/umisc.h"
22 #include "unicode/parseerr.h"
130 typedef void* UNumberFormat;
131 
135 typedef enum UNumberFormatStyle {
213 
218  UNUM_ROUND_CEILING,
219  UNUM_ROUND_FLOOR,
220  UNUM_ROUND_DOWN,
221  UNUM_ROUND_UP,
227  UNUM_ROUND_HALFDOWN,
228  UNUM_ROUND_HALFUP,
240 
245  UNUM_PAD_BEFORE_PREFIX,
246  UNUM_PAD_AFTER_PREFIX,
247  UNUM_PAD_BEFORE_SUFFIX,
248  UNUM_PAD_AFTER_SUFFIX
250 
256  UNUM_CURRENCY_MATCH,
257  UNUM_CURRENCY_SURROUNDING_MATCH,
258  UNUM_CURRENCY_INSERT,
259  UNUM_CURRENCY_SPACING_COUNT
260 };
296  const UChar* pattern,
297  int32_t patternLength,
298  const char* locale,
299  UParseError* parseErr,
300  UErrorCode* status);
301 
302 
309 U_STABLE void U_EXPORT2
311 
312 #if U_SHOW_CPLUSPLUS_API
313 
315 
325 U_DEFINE_LOCAL_OPEN_POINTER(LocalUNumberFormatPointer, UNumberFormat, unum_close);
326 
328 
329 #endif
330 
340 unum_clone(const UNumberFormat *fmt,
341  UErrorCode *status);
342 
364 U_STABLE int32_t U_EXPORT2
365 unum_format( const UNumberFormat* fmt,
366  int32_t number,
367  UChar* result,
368  int32_t resultLength,
369  UFieldPosition *pos,
370  UErrorCode* status);
371 
393 U_STABLE int32_t U_EXPORT2
395  int64_t number,
396  UChar* result,
397  int32_t resultLength,
398  UFieldPosition *pos,
399  UErrorCode* status);
400 
422 U_STABLE int32_t U_EXPORT2
423 unum_formatDouble( const UNumberFormat* fmt,
424  double number,
425  UChar* result,
426  int32_t resultLength,
427  UFieldPosition *pos, /* 0 if ignore */
428  UErrorCode* status);
429 
455 U_STABLE int32_t U_EXPORT2
457  const char * number,
458  int32_t length,
459  UChar* result,
460  int32_t resultLength,
461  UFieldPosition *pos, /* 0 if ignore */
462  UErrorCode* status);
463 
485 U_STABLE int32_t U_EXPORT2
487  double number,
488  UChar* currency,
489  UChar* result,
490  int32_t resultLength,
491  UFieldPosition* pos, /* ignored if 0 */
492  UErrorCode* status);
493 
511 U_STABLE int32_t U_EXPORT2
512 unum_parse( const UNumberFormat* fmt,
513  const UChar* text,
514  int32_t textLength,
515  int32_t *parsePos /* 0 = start */,
516  UErrorCode *status);
517 
535 U_STABLE int64_t U_EXPORT2
536 unum_parseInt64(const UNumberFormat* fmt,
537  const UChar* text,
538  int32_t textLength,
539  int32_t *parsePos /* 0 = start */,
540  UErrorCode *status);
541 
559 U_STABLE double U_EXPORT2
560 unum_parseDouble( const UNumberFormat* fmt,
561  const UChar* text,
562  int32_t textLength,
563  int32_t *parsePos /* 0 = start */,
564  UErrorCode *status);
565 
566 
592 U_STABLE int32_t U_EXPORT2
594  const UChar* text,
595  int32_t textLength,
596  int32_t *parsePos /* 0 = start */,
597  char *outBuf,
598  int32_t outBufLength,
599  UErrorCode *status);
600 
620 U_STABLE double U_EXPORT2
622  const UChar* text,
623  int32_t textLength,
624  int32_t* parsePos, /* 0 = start */
625  UChar* currency,
626  UErrorCode* status);
627 
644 U_STABLE void U_EXPORT2
646  UBool localized,
647  const UChar *pattern,
648  int32_t patternLength,
649  UParseError *parseError,
650  UErrorCode *status
651  );
652 
663 U_STABLE const char* U_EXPORT2
664 unum_getAvailable(int32_t localeIndex);
665 
675 U_STABLE int32_t U_EXPORT2
676 unum_countAvailable(void);
677 
726 
743 U_STABLE int32_t U_EXPORT2
746 
766 U_STABLE void U_EXPORT2
769  int32_t newValue);
770 
771 
786 U_STABLE double U_EXPORT2
789 
804 U_STABLE void U_EXPORT2
807  double newValue);
808 
836 
855 U_STABLE int32_t U_EXPORT2
858  UChar* result,
859  int32_t resultLength,
860  UErrorCode* status);
861 
878 U_STABLE void U_EXPORT2
881  const UChar* newValue,
882  int32_t newValueLength,
883  UErrorCode *status);
884 
901 U_STABLE int32_t U_EXPORT2
902 unum_toPattern( const UNumberFormat* fmt,
903  UBool isPatternLocalized,
904  UChar* result,
905  int32_t resultLength,
906  UErrorCode* status);
907 
908 
913 typedef enum UNumberFormatSymbol {
992 
1009 U_STABLE int32_t U_EXPORT2
1010 unum_getSymbol(const UNumberFormat *fmt,
1011  UNumberFormatSymbol symbol,
1012  UChar *buffer,
1013  int32_t size,
1014  UErrorCode *status);
1015 
1029 U_STABLE void U_EXPORT2
1031  UNumberFormatSymbol symbol,
1032  const UChar *value,
1033  int32_t length,
1034  UErrorCode *status);
1035 
1036 
1046 U_STABLE const char* U_EXPORT2
1048  ULocDataLocaleType type,
1049  UErrorCode* status);
1050 
1051 #endif /* #if !UCONFIG_NO_FORMATTING */
1052 
1053 #endif