]> git.saurik.com Git - apple/icu.git/blob - icuSources/common/ucnv_io.h
ICU-3.13.tar.gz
[apple/icu.git] / icuSources / common / ucnv_io.h
1 /*
2 **********************************************************************
3 * Copyright (C) 1999-2003, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 *
7 *
8 * ucnv_io.h:
9 * defines variables and functions pertaining to file access, and name resolution
10 * aspect of the library
11 */
12
13 #ifndef UCNV_IO_H
14 #define UCNV_IO_H
15
16 #include "unicode/utypes.h"
17
18 #define UCNV_AMBIGUOUS_ALIAS_MAP_BIT 0x8000
19 #define UCNV_CONVERTER_INDEX_MASK 0xFFF
20 #define UCNV_NUM_RESERVED_TAGS 2
21 #define UCNV_NUM_HIDDEN_TAGS 1
22
23 /**
24 * Remove the underscores, dashes and spaces from the name, and convert
25 * the name to lower case.
26 * @param dst The destination buffer, which is <= the buffer of name.
27 * @param dst The destination buffer, which is <= the buffer of name.
28 * @return the destination buffer.
29 */
30 U_CFUNC char * U_EXPORT2
31 ucnv_io_stripForCompare(char *dst, const char *name);
32
33 /**
34 * Map a converter alias name to a canonical converter name.
35 * The alias is searched for case-insensitively, the converter name
36 * is returned in mixed-case.
37 * Returns NULL if the alias is not found.
38 * @param alias The alias name to be searched.
39 * @param pErrorCode The error code
40 * @return the converter name in mixed-case, return NULL if the alias is not found.
41 */
42 U_CFUNC const char *
43 ucnv_io_getConverterName(const char *alias, UErrorCode *pErrorCode);
44
45 /**
46 * The count for ucnv_io_getAliases and ucnv_io_getAlias
47 * @param alias The alias name to be counted
48 * @param pErrorCode The error code
49 * @return the alias count
50 */
51 U_CFUNC uint16_t
52 ucnv_io_countAliases(const char *alias, UErrorCode *pErrorCode);
53
54 /**
55 * Search case-insensitively for a converter alias and set aliases to
56 * a pointer to the list of aliases for the actual converter.
57 * The first "alias" is the canonical converter name.
58 * The aliases are stored consecutively, in mixed case, each NUL-terminated.
59 * There are as many strings in this list as the return value specifies.
60 * Returns the number of aliases including the canonical converter name,
61 * or 0 if the alias is not found.
62 * @param alias The canonical converter name
63 * @param start
64 * @param aliases A pointer to the list of aliases for the actual converter
65 * @return the number of aliases including the canonical converter name, or 0 if the alias is not found.
66 */
67 U_CFUNC uint16_t
68 ucnv_io_getAliases(const char *alias, uint16_t start, const char **aliases, UErrorCode *pErrorCode);
69
70 /**
71 * Search case-insensitively for a converter alias and return
72 * the (n)th alias.
73 * Returns NULL if the alias is not found.
74 * @param alias The converter alias
75 * @param n The number specifies which alias to get
76 * @param pErrorCode The error code
77 * @return the (n)th alias and return NULL if the alias is not found.
78 */
79 U_CFUNC const char *
80 ucnv_io_getAlias(const char *alias, uint16_t n, UErrorCode *pErrorCode);
81
82 /**
83 * Return the number of all standard names.
84 * @param pErrorCode The error code
85 * @return the number of all standard names
86 */
87 U_CFUNC uint16_t
88 ucnv_io_countStandards(UErrorCode *pErrorCode);
89
90 /**
91 * Return the number of all converter names.
92 * @param pErrorCode The error code
93 * @return the number of all converter names
94 */
95 U_CFUNC uint16_t
96 ucnv_io_countAvailableConverters(UErrorCode *pErrorCode);
97
98 /**
99 * Return the (n)th converter name in mixed case, or NULL
100 * if there is none (typically, if the data cannot be loaded).
101 * 0<=index<ucnv_io_countAvailableConverters().
102 * @param n The number specifies which converter name to get
103 * @param pErrorCode The error code
104 * @return the (n)th converter name in mixed case, or NULL if there is none.
105 */
106 U_CFUNC const char *
107 ucnv_io_getAvailableConverter(uint16_t n, UErrorCode *pErrorCode);
108
109 /**
110 * Return the (n)th converter name in mixed case, or NULL
111 * if there is none (typically, if the data cannot be loaded).
112 * 0<=index<ucnv_io_countAvailableConverters().
113 */
114 U_CFUNC void
115 ucnv_io_flushAvailableConverterCache(void);
116
117 /**
118 * Return the number of all aliases (and converter names).
119 * @param pErrorCode The error code
120 * @return the number of all aliases
121 */
122 U_CFUNC uint16_t
123 ucnv_io_countAvailableAliases(UErrorCode *pErrorCode);
124
125 /**
126 * Get the name of the default converter.
127 * This name is already resolved by <code>ucnv_io_getConverterName()</code>.
128 * @return the name of the default converter
129 */
130 U_CFUNC const char *
131 ucnv_io_getDefaultConverterName(void);
132
133 /**
134 * Set the name of the default converter.
135 * @param name The name set to the default converter
136 */
137 U_CFUNC void
138 ucnv_io_setDefaultConverterName(const char *name);
139
140 #endif /* _UCNV_IO */
141
142 /*
143 * Hey, Emacs, please set the following:
144 *
145 * Local Variables:
146 * indent-tabs-mode: nil
147 * End:
148 *
149 */