]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/ucnv_io.h
2 **********************************************************************
3 * Copyright (C) 1999-2004, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
9 * defines variables and functions pertaining to file access, and name resolution
10 * aspect of the library
16 #include "unicode/utypes.h"
18 #if !UCONFIG_NO_CONVERSION
22 #define UCNV_AMBIGUOUS_ALIAS_MAP_BIT 0x8000
23 #define UCNV_CONVERTER_INDEX_MASK 0xFFF
24 #define UCNV_NUM_RESERVED_TAGS 2
25 #define UCNV_NUM_HIDDEN_TAGS 1
28 * \var ucnv_io_stripForCompare
29 * Remove the underscores, dashes and spaces from the name, and convert
30 * the name to lower case.
31 * @param dst The destination buffer, which is <= the buffer of name.
32 * @param dst The destination buffer, which is <= the buffer of name.
33 * @return the destination buffer.
35 #if U_CHARSET_FAMILY==U_ASCII_FAMILY
36 # define ucnv_io_stripForCompare ucnv_io_stripASCIIForCompare
37 #elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY
38 # define ucnv_io_stripForCompare ucnv_io_stripEBCDICForCompare
40 # error U_CHARSET_FAMILY is not valid
43 U_CFUNC
char * U_EXPORT2
44 ucnv_io_stripASCIIForCompare(char *dst
, const char *name
);
46 U_CFUNC
char * U_EXPORT2
47 ucnv_io_stripEBCDICForCompare(char *dst
, const char *name
);
50 * Map a converter alias name to a canonical converter name.
51 * The alias is searched for case-insensitively, the converter name
52 * is returned in mixed-case.
53 * Returns NULL if the alias is not found.
54 * @param alias The alias name to be searched.
55 * @param pErrorCode The error code
56 * @return the converter name in mixed-case, return NULL if the alias is not found.
59 ucnv_io_getConverterName(const char *alias
, UErrorCode
*pErrorCode
);
62 * The count for ucnv_io_getAliases and ucnv_io_getAlias
63 * @param alias The alias name to be counted
64 * @param pErrorCode The error code
65 * @return the alias count
68 ucnv_io_countAliases(const char *alias
, UErrorCode
*pErrorCode
);
71 * Search case-insensitively for a converter alias and set aliases to
72 * a pointer to the list of aliases for the actual converter.
73 * The first "alias" is the canonical converter name.
74 * The aliases are stored consecutively, in mixed case, each NUL-terminated.
75 * There are as many strings in this list as the return value specifies.
76 * Returns the number of aliases including the canonical converter name,
77 * or 0 if the alias is not found.
78 * @param alias The canonical converter name
80 * @param aliases A pointer to the list of aliases for the actual converter
81 * @return the number of aliases including the canonical converter name, or 0 if the alias is not found.
84 ucnv_io_getAliases(const char *alias
, uint16_t start
, const char **aliases
, UErrorCode
*pErrorCode
);
87 * Search case-insensitively for a converter alias and return
89 * Returns NULL if the alias is not found.
90 * @param alias The converter alias
91 * @param n The number specifies which alias to get
92 * @param pErrorCode The error code
93 * @return the (n)th alias and return NULL if the alias is not found.
96 ucnv_io_getAlias(const char *alias
, uint16_t n
, UErrorCode
*pErrorCode
);
99 * Return the number of all standard names.
100 * @param pErrorCode The error code
101 * @return the number of all standard names
104 ucnv_io_countStandards(UErrorCode
*pErrorCode
);
107 * Return the number of all converter names.
108 * @param pErrorCode The error code
109 * @return the number of all converter names
112 ucnv_io_countAvailableConverters(UErrorCode
*pErrorCode
);
115 * Return the (n)th converter name in mixed case, or NULL
116 * if there is none (typically, if the data cannot be loaded).
117 * 0<=index<ucnv_io_countAvailableConverters().
118 * @param n The number specifies which converter name to get
119 * @param pErrorCode The error code
120 * @return the (n)th converter name in mixed case, or NULL if there is none.
123 ucnv_io_getAvailableConverter(uint16_t n
, UErrorCode
*pErrorCode
);
126 * Return the (n)th converter name in mixed case, or NULL
127 * if there is none (typically, if the data cannot be loaded).
128 * 0<=index<ucnv_io_countAvailableConverters().
131 ucnv_io_flushAvailableConverterCache(void);
134 * Return the number of all aliases (and converter names).
135 * @param pErrorCode The error code
136 * @return the number of all aliases
139 ucnv_io_countAvailableAliases(UErrorCode
*pErrorCode
);
142 * Get the name of the default converter.
143 * This name is already resolved by <code>ucnv_io_getConverterName()</code>.
144 * @return the name of the default converter
147 ucnv_io_getDefaultConverterName(void);
150 * Set the name of the default converter.
151 * @param name The name set to the default converter
154 ucnv_io_setDefaultConverterName(const char *name
);
157 * Swap an ICU converter alias table. See ucnv_io.c.
160 U_CAPI
int32_t U_EXPORT2
161 ucnv_swapAliases(const UDataSwapper
*ds
,
162 const void *inData
, int32_t length
, void *outData
,
163 UErrorCode
*pErrorCode
);
167 #endif /* _UCNV_IO */
170 * Hey, Emacs, please set the following:
173 * indent-tabs-mode: nil