Current Path: > > opt > > alt > > libicu > usr > include > unicode
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
alphaindex.h | File | 27055 bytes | November 07 2019 06:58:02. | |
appendable.h | File | 8632 bytes | November 07 2019 06:58:02. | |
basictz.h | File | 9055 bytes | November 07 2019 06:58:02. | |
brkiter.h | File | 28303 bytes | November 07 2019 06:58:02. | |
bytestream.h | File | 9767 bytes | November 07 2019 06:58:02. | |
bytestrie.h | File | 19718 bytes | November 07 2019 06:58:02. | |
bytestriebuilder.h | File | 7186 bytes | November 07 2019 06:58:02. | |
calendar.h | File | 107581 bytes | November 07 2019 06:58:02. | |
caniter.h | File | 7550 bytes | November 07 2019 06:58:02. | |
casemap.h | File | 25871 bytes | November 07 2019 06:58:02. | |
char16ptr.h | File | 7331 bytes | November 07 2019 06:58:02. | |
chariter.h | File | 24573 bytes | November 07 2019 06:58:02. | |
choicfmt.h | File | 24418 bytes | November 07 2019 06:58:02. | |
coleitr.h | File | 14033 bytes | November 07 2019 06:58:02. | |
coll.h | File | 56928 bytes | November 07 2019 06:58:02. | |
compactdecimalformat.h | File | 6971 bytes | November 07 2019 06:58:02. | |
curramt.h | File | 3782 bytes | November 07 2019 06:58:02. | |
currpinf.h | File | 7412 bytes | November 07 2019 06:58:02. | |
currunit.h | File | 4082 bytes | November 07 2019 06:58:02. | |
datefmt.h | File | 41334 bytes | November 07 2019 06:58:02. | |
dbbi.h | File | 1133 bytes | November 07 2019 06:58:02. | |
dcfmtsym.h | File | 20584 bytes | November 07 2019 06:58:02. | |
decimfmt.h | File | 89926 bytes | November 07 2019 06:58:02. | |
docmain.h | File | 7123 bytes | November 07 2019 06:58:02. | |
dtfmtsym.h | File | 38548 bytes | November 07 2019 06:58:02. | |
dtintrv.h | File | 3869 bytes | November 07 2019 06:58:02. | |
dtitvfmt.h | File | 47676 bytes | November 07 2019 06:58:02. | |
dtitvinf.h | File | 18902 bytes | November 07 2019 06:58:02. | |
dtptngen.h | File | 25681 bytes | November 07 2019 06:58:02. | |
dtrule.h | File | 8831 bytes | November 07 2019 06:58:02. | |
edits.h | File | 21169 bytes | November 07 2019 06:58:02. | |
enumset.h | File | 2130 bytes | November 07 2019 06:58:02. | |
errorcode.h | File | 4894 bytes | November 07 2019 06:58:02. | |
fieldpos.h | File | 8838 bytes | November 07 2019 06:58:02. | |
filteredbrk.h | File | 5364 bytes | November 07 2019 06:58:02. | |
fmtable.h | File | 24946 bytes | November 07 2019 06:58:02. | |
format.h | File | 12741 bytes | November 07 2019 06:58:02. | |
formattedvalue.h | File | 9963 bytes | November 07 2019 06:58:02. | |
fpositer.h | File | 3047 bytes | November 07 2019 06:58:02. | |
gender.h | File | 3347 bytes | November 07 2019 06:58:02. | |
gregocal.h | File | 32331 bytes | November 07 2019 06:58:02. | |
icudataver.h | File | 1051 bytes | November 07 2019 06:58:02. | |
icuplug.h | File | 12166 bytes | November 07 2019 06:58:02. | |
idna.h | File | 12938 bytes | November 07 2019 06:58:02. | |
listformatter.h | File | 9644 bytes | November 07 2019 06:58:02. | |
localebuilder.h | File | 10792 bytes | November 07 2019 06:58:02. | |
localpointer.h | File | 20159 bytes | November 07 2019 06:58:02. | |
locdspnm.h | File | 7231 bytes | November 07 2019 06:58:02. | |
locid.h | File | 46015 bytes | November 07 2019 06:58:02. | |
measfmt.h | File | 11710 bytes | November 07 2019 06:58:02. | |
measunit.h | File | 90283 bytes | November 07 2019 06:58:02. | |
measure.h | File | 4361 bytes | November 07 2019 06:58:02. | |
messagepattern.h | File | 34460 bytes | November 07 2019 06:58:02. | |
msgfmt.h | File | 45099 bytes | November 07 2019 06:58:02. | |
normalizer2.h | File | 34789 bytes | November 07 2019 06:58:02. | |
normlzr.h | File | 31476 bytes | November 07 2019 06:58:02. | |
nounit.h | File | 2693 bytes | November 07 2019 06:58:02. | |
numberformatter.h | File | 86654 bytes | November 07 2019 06:58:02. | |
numberrangeformatter.h | File | 30653 bytes | November 07 2019 06:58:02. | |
numfmt.h | File | 50530 bytes | November 07 2019 06:58:02. | |
numsys.h | File | 7303 bytes | November 07 2019 06:58:02. | |
parseerr.h | File | 3155 bytes | November 07 2019 06:58:02. | |
parsepos.h | File | 5630 bytes | November 07 2019 06:58:02. | |
platform.h | File | 27754 bytes | November 07 2019 06:58:02. | |
plurfmt.h | File | 25786 bytes | November 07 2019 06:58:02. | |
plurrule.h | File | 18774 bytes | November 07 2019 06:58:02. | |
ptypes.h | File | 3577 bytes | November 07 2019 06:58:02. | |
putil.h | File | 6487 bytes | November 07 2019 06:58:02. | |
rbbi.h | File | 27053 bytes | November 07 2019 06:58:02. | |
rbnf.h | File | 50984 bytes | November 07 2019 06:58:02. | |
rbtz.h | File | 15838 bytes | November 07 2019 06:58:02. | |
regex.h | File | 86320 bytes | November 07 2019 06:58:02. | |
region.h | File | 9342 bytes | November 07 2019 06:58:02. | |
reldatefmt.h | File | 22910 bytes | November 07 2019 06:58:02. | |
rep.h | File | 9726 bytes | November 07 2019 06:58:02. | |
resbund.h | File | 18440 bytes | November 07 2019 06:58:02. | |
schriter.h | File | 6410 bytes | November 07 2019 06:58:02. | |
scientificnumberformatter.h | File | 6474 bytes | November 07 2019 06:58:02. | |
search.h | File | 22742 bytes | November 07 2019 06:58:02. | |
selfmt.h | File | 14579 bytes | November 07 2019 06:58:02. | |
simpleformatter.h | File | 12826 bytes | November 07 2019 06:58:02. | |
simpletz.h | File | 46389 bytes | November 07 2019 06:58:02. | |
smpdtfmt.h | File | 72597 bytes | November 07 2019 06:58:02. | |
sortkey.h | File | 11383 bytes | November 07 2019 06:58:02. | |
std_string.h | File | 1015 bytes | November 07 2019 06:58:02. | |
strenum.h | File | 10279 bytes | November 07 2019 06:58:02. | |
stringoptions.h | File | 5926 bytes | November 07 2019 06:58:02. | |
stringpiece.h | File | 6610 bytes | November 07 2019 06:58:02. | |
stringtriebuilder.h | File | 15636 bytes | November 07 2019 06:58:02. | |
stsearch.h | File | 21801 bytes | November 07 2019 06:58:02. | |
symtable.h | File | 4312 bytes | November 07 2019 06:58:02. | |
tblcoll.h | File | 37272 bytes | November 07 2019 06:58:02. | |
timezone.h | File | 42189 bytes | November 07 2019 06:58:02. | |
tmunit.h | File | 3371 bytes | November 07 2019 06:58:02. | |
tmutamt.h | File | 4918 bytes | November 07 2019 06:58:02. | |
tmutfmt.h | File | 7977 bytes | November 07 2019 06:58:02. | |
translit.h | File | 67339 bytes | November 07 2019 06:58:02. | |
tzfmt.h | File | 43846 bytes | November 07 2019 06:58:02. | |
tznames.h | File | 17190 bytes | November 07 2019 06:58:02. | |
tzrule.h | File | 36170 bytes | November 07 2019 06:58:02. | |
tztrans.h | File | 6214 bytes | November 07 2019 06:58:02. | |
ubidi.h | File | 91711 bytes | November 07 2019 06:58:02. | |
ubiditransform.h | File | 12950 bytes | November 07 2019 06:58:02. | |
ubrk.h | File | 24547 bytes | November 07 2019 06:58:02. | |
ucal.h | File | 56876 bytes | November 07 2019 06:58:02. | |
ucasemap.h | File | 15546 bytes | November 07 2019 06:58:02. | |
ucat.h | File | 5484 bytes | November 07 2019 06:58:02. | |
uchar.h | File | 144035 bytes | November 07 2019 06:58:02. | |
ucharstrie.h | File | 21569 bytes | November 07 2019 06:58:02. | |
ucharstriebuilder.h | File | 7316 bytes | November 07 2019 06:58:02. | |
uchriter.h | File | 13457 bytes | November 07 2019 06:58:02. | |
uclean.h | File | 11474 bytes | November 07 2019 06:58:02. | |
ucnv.h | File | 85085 bytes | November 07 2019 06:58:02. | |
ucnv_cb.h | File | 6748 bytes | November 07 2019 06:58:02. | |
ucnv_err.h | File | 21492 bytes | November 07 2019 06:58:02. | |
ucnvsel.h | File | 6283 bytes | November 07 2019 06:58:02. | |
ucol.h | File | 62864 bytes | November 07 2019 06:58:02. | |
ucoleitr.h | File | 9684 bytes | November 07 2019 06:58:02. | |
uconfig.h | File | 12338 bytes | November 07 2019 06:58:02. | |
ucpmap.h | File | 5709 bytes | November 07 2019 06:58:02. | |
ucptrie.h | File | 22824 bytes | November 07 2019 06:58:02. | |
ucsdet.h | File | 15018 bytes | November 07 2019 06:58:02. | |
ucurr.h | File | 16536 bytes | November 07 2019 06:58:02. | |
udat.h | File | 62267 bytes | November 07 2019 06:58:02. | |
udata.h | File | 15905 bytes | November 07 2019 06:58:02. | |
udateintervalformat.h | File | 10272 bytes | November 07 2019 06:58:02. | |
udatpg.h | File | 26564 bytes | November 07 2019 06:58:02. | |
udisplaycontext.h | File | 6029 bytes | November 07 2019 06:58:02. | |
uenum.h | File | 7970 bytes | November 07 2019 06:58:02. | |
ufieldpositer.h | File | 4461 bytes | November 07 2019 06:58:02. | |
uformattable.h | File | 11198 bytes | November 07 2019 06:58:02. | |
uformattedvalue.h | File | 12430 bytes | November 07 2019 06:58:02. | |
ugender.h | File | 2052 bytes | November 07 2019 06:58:02. | |
uidna.h | File | 34169 bytes | November 07 2019 06:58:02. | |
uiter.h | File | 23319 bytes | November 07 2019 06:58:02. | |
uldnames.h | File | 10702 bytes | November 07 2019 06:58:02. | |
ulistformatter.h | File | 9043 bytes | November 07 2019 06:58:02. | |
uloc.h | File | 51971 bytes | November 07 2019 06:58:02. | |
ulocdata.h | File | 11533 bytes | November 07 2019 06:58:02. | |
umachine.h | File | 13509 bytes | November 07 2019 06:58:02. | |
umisc.h | File | 1365 bytes | November 07 2019 06:58:02. | |
umsg.h | File | 24812 bytes | November 07 2019 06:58:02. | |
umutablecptrie.h | File | 8477 bytes | November 07 2019 06:58:02. | |
unifilt.h | File | 3716 bytes | November 07 2019 06:58:02. | |
unifunct.h | File | 4079 bytes | November 07 2019 06:58:02. | |
unimatch.h | File | 6184 bytes | November 07 2019 06:58:02. | |
unirepl.h | File | 3403 bytes | November 07 2019 06:58:02. | |
uniset.h | File | 66440 bytes | November 07 2019 06:58:02. | |
unistr.h | File | 174477 bytes | November 07 2019 06:58:02. | |
unorm.h | File | 20938 bytes | November 07 2019 06:58:02. | |
unorm2.h | File | 25254 bytes | November 07 2019 06:58:02. | |
unum.h | File | 54832 bytes | November 07 2019 06:58:02. | |
unumberformatter.h | File | 25795 bytes | November 07 2019 06:58:02. | |
unumsys.h | File | 7387 bytes | November 07 2019 06:58:02. | |
uobject.h | File | 11106 bytes | November 07 2019 06:58:02. | |
upluralrules.h | File | 8068 bytes | November 07 2019 06:58:02. | |
uregex.h | File | 73784 bytes | November 07 2019 06:58:02. | |
uregion.h | File | 10073 bytes | November 07 2019 06:58:02. | |
ureldatefmt.h | File | 17670 bytes | November 07 2019 06:58:02. | |
urename.h | File | 134551 bytes | November 07 2019 06:58:02. | |
urep.h | File | 5507 bytes | November 07 2019 06:58:02. | |
ures.h | File | 37415 bytes | November 07 2019 06:58:02. | |
uscript.h | File | 27510 bytes | November 07 2019 06:58:02. | |
usearch.h | File | 39038 bytes | November 07 2019 06:58:02. | |
uset.h | File | 40958 bytes | November 07 2019 06:58:02. | |
usetiter.h | File | 9719 bytes | November 07 2019 06:58:02. | |
ushape.h | File | 18432 bytes | November 07 2019 06:58:02. | |
uspoof.h | File | 67613 bytes | November 07 2019 06:58:02. | |
usprep.h | File | 8331 bytes | November 07 2019 06:58:02. | |
ustdio.h | File | 39469 bytes | November 07 2019 06:58:02. | |
ustream.h | File | 1844 bytes | November 07 2019 06:58:02. | |
ustring.h | File | 74211 bytes | November 07 2019 06:58:02. | |
ustringtrie.h | File | 3224 bytes | November 07 2019 06:58:02. | |
utext.h | File | 59505 bytes | November 07 2019 06:58:02. | |
utf.h | File | 8046 bytes | November 07 2019 06:58:02. | |
utf16.h | File | 22866 bytes | November 07 2019 06:58:02. | |
utf32.h | File | 763 bytes | November 07 2019 06:58:02. | |
utf8.h | File | 30682 bytes | November 07 2019 06:58:02. | |
utf_old.h | File | 44827 bytes | November 07 2019 06:58:02. | |
utmscale.h | File | 14113 bytes | November 07 2019 06:58:02. | |
utrace.h | File | 14219 bytes | November 07 2019 06:58:02. | |
utrans.h | File | 26157 bytes | November 07 2019 06:58:02. | |
utypes.h | File | 31108 bytes | November 07 2019 06:58:02. | |
uvernum.h | File | 6832 bytes | November 07 2019 06:58:02. | |
uversion.h | File | 6865 bytes | November 07 2019 06:58:02. | |
vtzone.h | File | 20651 bytes | November 07 2019 06:58:02. |
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /******************************************************************** * COPYRIGHT: * Copyright (c) 1997-2011, International Business Machines Corporation and * others. All Rights Reserved. * Copyright (C) 2010 , Yahoo! Inc. ******************************************************************** * * file name: umsg.h * encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * * Change history: * * 08/5/2001 Ram Added C wrappers for C++ API. ********************************************************************/ #ifndef UMSG_H #define UMSG_H #include "unicode/utypes.h" #if !UCONFIG_NO_FORMATTING #include "unicode/localpointer.h" #include "unicode/uloc.h" #include "unicode/parseerr.h" #include <stdarg.h> /** * \file * \brief C API: MessageFormat * * <h2>MessageFormat C API </h2> * * <p>MessageFormat prepares strings for display to users, * with optional arguments (variables/placeholders). * The arguments can occur in any order, which is necessary for translation * into languages with different grammars. * * <p>The opaque UMessageFormat type is a thin C wrapper around * a C++ MessageFormat. It is constructed from a <em>pattern</em> string * with arguments in {curly braces} which will be replaced by formatted values. * * <p>Currently, the C API supports only numbered arguments. * * <p>For details about the pattern syntax and behavior, * especially about the ASCII apostrophe vs. the * real apostrophe (single quote) character \htmlonly’\endhtmlonly (U+2019), * see the C++ MessageFormat class documentation. * * <p>Here are some examples of C API usage: * Example 1: * <pre> * \code * UChar *result, *tzID, *str; * UChar pattern[100]; * int32_t resultLengthOut, resultlength; * UCalendar *cal; * UDate d1; * UDateFormat *def1; * UErrorCode status = U_ZERO_ERROR; * * str=(UChar*)malloc(sizeof(UChar) * (strlen("disturbance in force") +1)); * u_uastrcpy(str, "disturbance in force"); * tzID=(UChar*)malloc(sizeof(UChar) * 4); * u_uastrcpy(tzID, "PST"); * cal=ucal_open(tzID, u_strlen(tzID), "en_US", UCAL_TRADITIONAL, &status); * ucal_setDateTime(cal, 1999, UCAL_MARCH, 18, 0, 0, 0, &status); * d1=ucal_getMillis(cal, &status); * u_uastrcpy(pattern, "On {0, date, long}, there was a {1} on planet {2,number,integer}"); * resultlength=0; * resultLengthOut=u_formatMessage( "en_US", pattern, u_strlen(pattern), NULL, resultlength, &status, d1, str, 7); * if(status==U_BUFFER_OVERFLOW_ERROR){ * status=U_ZERO_ERROR; * resultlength=resultLengthOut+1; * result=(UChar*)realloc(result, sizeof(UChar) * resultlength); * u_formatMessage( "en_US", pattern, u_strlen(pattern), result, resultlength, &status, d1, str, 7); * } * printf("%s\n", austrdup(result) );//austrdup( a function used to convert UChar* to char*) * //output>: "On March 18, 1999, there was a disturbance in force on planet 7 * \endcode * </pre> * Typically, the message format will come from resources, and the * arguments will be dynamically set at runtime. * <P> * Example 2: * <pre> * \code * UChar* str; * UErrorCode status = U_ZERO_ERROR; * UChar *result; * UChar pattern[100]; * int32_t resultlength, resultLengthOut, i; * double testArgs= { 100.0, 1.0, 0.0}; * * str=(UChar*)malloc(sizeof(UChar) * 10); * u_uastrcpy(str, "MyDisk"); * u_uastrcpy(pattern, "The disk {1} contains {0,choice,0#no files|1#one file|1<{0,number,integer} files}"); * for(i=0; i<3; i++){ * resultlength=0; * resultLengthOut=u_formatMessage( "en_US", pattern, u_strlen(pattern), NULL, resultlength, &status, testArgs[i], str); * if(status==U_BUFFER_OVERFLOW_ERROR){ * status=U_ZERO_ERROR; * resultlength=resultLengthOut+1; * result=(UChar*)malloc(sizeof(UChar) * resultlength); * u_formatMessage( "en_US", pattern, u_strlen(pattern), result, resultlength, &status, testArgs[i], str); * } * printf("%s\n", austrdup(result) ); //austrdup( a function used to convert UChar* to char*) * free(result); * } * // output, with different testArgs: * // output: The disk "MyDisk" contains 100 files. * // output: The disk "MyDisk" contains one file. * // output: The disk "MyDisk" contains no files. * \endcode * </pre> * * * Example 3: * <pre> * \code * UChar* str; * UChar* str1; * UErrorCode status = U_ZERO_ERROR; * UChar *result; * UChar pattern[100]; * UChar expected[100]; * int32_t resultlength,resultLengthOut; * str=(UChar*)malloc(sizeof(UChar) * 25); * u_uastrcpy(str, "Kirti"); * str1=(UChar*)malloc(sizeof(UChar) * 25); * u_uastrcpy(str1, "female"); * log_verbose("Testing message format with Select test #1\n:"); * u_uastrcpy(pattern, "{0} est {1, select, female {all\\u00E9e} other {all\\u00E9}} \\u00E0 Paris."); * u_uastrcpy(expected, "Kirti est all\\u00E9e \\u00E0 Paris."); * resultlength=0; * resultLengthOut=u_formatMessage( "fr", pattern, u_strlen(pattern), NULL, resultlength, &status, str , str1); * if(status==U_BUFFER_OVERFLOW_ERROR) * { * status=U_ZERO_ERROR; * resultlength=resultLengthOut+1; * result=(UChar*)malloc(sizeof(UChar) * resultlength); * u_formatMessage( "fr", pattern, u_strlen(pattern), result, resultlength, &status, str , str1); * if(u_strcmp(result, expected)==0) * log_verbose("PASS: MessagFormat successful on Select test#1\n"); * else{ * log_err("FAIL: Error in MessageFormat on Select test#1\n GOT %s EXPECTED %s\n", austrdup(result), * austrdup(expected) ); * } * free(result); * } * \endcode * </pre> */ /** * Format a message for a locale. * This function may perform re-ordering of the arguments depending on the * locale. For all numeric arguments, double is assumed unless the type is * explicitly integer. All choice format arguments must be of type double. * @param locale The locale for which the message will be formatted * @param pattern The pattern specifying the message's format * @param patternLength The length of pattern * @param result A pointer to a buffer to receive the formatted message. * @param resultLength The maximum size of result. * @param status A pointer to an UErrorCode to receive any errors * @param ... A variable-length argument list containing the arguments specified * in pattern. * @return The total buffer size needed; if greater than resultLength, the * output was truncated. * @see u_parseMessage * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_formatMessage(const char *locale, const UChar *pattern, int32_t patternLength, UChar *result, int32_t resultLength, UErrorCode *status, ...); /** * Format a message for a locale. * This function may perform re-ordering of the arguments depending on the * locale. For all numeric arguments, double is assumed unless the type is * explicitly integer. All choice format arguments must be of type double. * @param locale The locale for which the message will be formatted * @param pattern The pattern specifying the message's format * @param patternLength The length of pattern * @param result A pointer to a buffer to receive the formatted message. * @param resultLength The maximum size of result. * @param ap A variable-length argument list containing the arguments specified * @param status A pointer to an UErrorCode to receive any errors * in pattern. * @return The total buffer size needed; if greater than resultLength, the * output was truncated. * @see u_parseMessage * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_vformatMessage( const char *locale, const UChar *pattern, int32_t patternLength, UChar *result, int32_t resultLength, va_list ap, UErrorCode *status); /** * Parse a message. * For numeric arguments, this function will always use doubles. Integer types * should not be passed. * This function is not able to parse all output from {@link #u_formatMessage }. * @param locale The locale for which the message is formatted * @param pattern The pattern specifying the message's format * @param patternLength The length of pattern * @param source The text to parse. * @param sourceLength The length of source, or -1 if null-terminated. * @param status A pointer to an UErrorCode to receive any errors * @param ... A variable-length argument list containing the arguments * specified in pattern. * @see u_formatMessage * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 u_parseMessage( const char *locale, const UChar *pattern, int32_t patternLength, const UChar *source, int32_t sourceLength, UErrorCode *status, ...); /** * Parse a message. * For numeric arguments, this function will always use doubles. Integer types * should not be passed. * This function is not able to parse all output from {@link #u_formatMessage }. * @param locale The locale for which the message is formatted * @param pattern The pattern specifying the message's format * @param patternLength The length of pattern * @param source The text to parse. * @param sourceLength The length of source, or -1 if null-terminated. * @param ap A variable-length argument list containing the arguments * @param status A pointer to an UErrorCode to receive any errors * specified in pattern. * @see u_formatMessage * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 u_vparseMessage(const char *locale, const UChar *pattern, int32_t patternLength, const UChar *source, int32_t sourceLength, va_list ap, UErrorCode *status); /** * Format a message for a locale. * This function may perform re-ordering of the arguments depending on the * locale. For all numeric arguments, double is assumed unless the type is * explicitly integer. All choice format arguments must be of type double. * @param locale The locale for which the message will be formatted * @param pattern The pattern specifying the message's format * @param patternLength The length of pattern * @param result A pointer to a buffer to receive the formatted message. * @param resultLength The maximum size of result. * @param status A pointer to an UErrorCode to receive any errors * @param ... A variable-length argument list containing the arguments specified * in pattern. * @param parseError A pointer to UParseError to receive information about errors * occurred during parsing. * @return The total buffer size needed; if greater than resultLength, the * output was truncated. * @see u_parseMessage * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_formatMessageWithError( const char *locale, const UChar *pattern, int32_t patternLength, UChar *result, int32_t resultLength, UParseError *parseError, UErrorCode *status, ...); /** * Format a message for a locale. * This function may perform re-ordering of the arguments depending on the * locale. For all numeric arguments, double is assumed unless the type is * explicitly integer. All choice format arguments must be of type double. * @param locale The locale for which the message will be formatted * @param pattern The pattern specifying the message's format * @param patternLength The length of pattern * @param result A pointer to a buffer to receive the formatted message. * @param resultLength The maximum size of result. * @param parseError A pointer to UParseError to receive information about errors * occurred during parsing. * @param ap A variable-length argument list containing the arguments specified * @param status A pointer to an UErrorCode to receive any errors * in pattern. * @return The total buffer size needed; if greater than resultLength, the * output was truncated. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 u_vformatMessageWithError( const char *locale, const UChar *pattern, int32_t patternLength, UChar *result, int32_t resultLength, UParseError* parseError, va_list ap, UErrorCode *status); /** * Parse a message. * For numeric arguments, this function will always use doubles. Integer types * should not be passed. * This function is not able to parse all output from {@link #u_formatMessage }. * @param locale The locale for which the message is formatted * @param pattern The pattern specifying the message's format * @param patternLength The length of pattern * @param source The text to parse. * @param sourceLength The length of source, or -1 if null-terminated. * @param parseError A pointer to UParseError to receive information about errors * occurred during parsing. * @param status A pointer to an UErrorCode to receive any errors * @param ... A variable-length argument list containing the arguments * specified in pattern. * @see u_formatMessage * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 u_parseMessageWithError(const char *locale, const UChar *pattern, int32_t patternLength, const UChar *source, int32_t sourceLength, UParseError *parseError, UErrorCode *status, ...); /** * Parse a message. * For numeric arguments, this function will always use doubles. Integer types * should not be passed. * This function is not able to parse all output from {@link #u_formatMessage }. * @param locale The locale for which the message is formatted * @param pattern The pattern specifying the message's format * @param patternLength The length of pattern * @param source The text to parse. * @param sourceLength The length of source, or -1 if null-terminated. * @param ap A variable-length argument list containing the arguments * @param parseError A pointer to UParseError to receive information about errors * occurred during parsing. * @param status A pointer to an UErrorCode to receive any errors * specified in pattern. * @see u_formatMessage * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 u_vparseMessageWithError(const char *locale, const UChar *pattern, int32_t patternLength, const UChar *source, int32_t sourceLength, va_list ap, UParseError *parseError, UErrorCode* status); /*----------------------- New experimental API --------------------------- */ /** * The message format object * @stable ICU 2.0 */ typedef void* UMessageFormat; /** * Open a message formatter with given pattern and for the given locale. * @param pattern A pattern specifying the format to use. * @param patternLength Length of the pattern to use * @param locale The locale for which the messages are formatted. * @param parseError A pointer to UParseError struct to receive any errors * occured during parsing. Can be NULL. * @param status A pointer to an UErrorCode to receive any errors. * @return A pointer to a UMessageFormat to use for formatting * messages, or 0 if an error occurred. * @stable ICU 2.0 */ U_STABLE UMessageFormat* U_EXPORT2 umsg_open( const UChar *pattern, int32_t patternLength, const char *locale, UParseError *parseError, UErrorCode *status); /** * Close a UMessageFormat. * Once closed, a UMessageFormat may no longer be used. * @param format The formatter to close. * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 umsg_close(UMessageFormat* format); #if U_SHOW_CPLUSPLUS_API U_NAMESPACE_BEGIN /** * \class LocalUMessageFormatPointer * "Smart pointer" class, closes a UMessageFormat via umsg_close(). * For most methods see the LocalPointerBase base class. * * @see LocalPointerBase * @see LocalPointer * @stable ICU 4.4 */ U_DEFINE_LOCAL_OPEN_POINTER(LocalUMessageFormatPointer, UMessageFormat, umsg_close); U_NAMESPACE_END #endif /** * Open a copy of a UMessageFormat. * This function performs a deep copy. * @param fmt The formatter to copy * @param status A pointer to an UErrorCode to receive any errors. * @return A pointer to a UDateFormat identical to fmt. * @stable ICU 2.0 */ U_STABLE UMessageFormat U_EXPORT2 umsg_clone(const UMessageFormat *fmt, UErrorCode *status); /** * Sets the locale. This locale is used for fetching default number or date * format information. * @param fmt The formatter to set * @param locale The locale the formatter should use. * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 umsg_setLocale(UMessageFormat *fmt, const char* locale); /** * Gets the locale. This locale is used for fetching default number or date * format information. * @param fmt The formatter to querry * @return the locale. * @stable ICU 2.0 */ U_STABLE const char* U_EXPORT2 umsg_getLocale(const UMessageFormat *fmt); /** * Sets the pattern. * @param fmt The formatter to use * @param pattern The pattern to be applied. * @param patternLength Length of the pattern to use * @param parseError Struct to receive information on position * of error if an error is encountered.Can be NULL. * @param status Output param set to success/failure code on * exit. If the pattern is invalid, this will be * set to a failure result. * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 umsg_applyPattern( UMessageFormat *fmt, const UChar* pattern, int32_t patternLength, UParseError* parseError, UErrorCode* status); /** * Gets the pattern. * @param fmt The formatter to use * @param result A pointer to a buffer to receive the pattern. * @param resultLength The maximum size of result. * @param status Output param set to success/failure code on * exit. If the pattern is invalid, this will be * set to a failure result. * @return the pattern of the format * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 umsg_toPattern(const UMessageFormat *fmt, UChar* result, int32_t resultLength, UErrorCode* status); /** * Format a message for a locale. * This function may perform re-ordering of the arguments depending on the * locale. For all numeric arguments, double is assumed unless the type is * explicitly integer. All choice format arguments must be of type double. * @param fmt The formatter to use * @param result A pointer to a buffer to receive the formatted message. * @param resultLength The maximum size of result. * @param status A pointer to an UErrorCode to receive any errors * @param ... A variable-length argument list containing the arguments * specified in pattern. * @return The total buffer size needed; if greater than resultLength, * the output was truncated. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 umsg_format( const UMessageFormat *fmt, UChar *result, int32_t resultLength, UErrorCode *status, ...); /** * Format a message for a locale. * This function may perform re-ordering of the arguments depending on the * locale. For all numeric arguments, double is assumed unless the type is * explicitly integer. All choice format arguments must be of type double. * @param fmt The formatter to use * @param result A pointer to a buffer to receive the formatted message. * @param resultLength The maximum size of result. * @param ap A variable-length argument list containing the arguments * @param status A pointer to an UErrorCode to receive any errors * specified in pattern. * @return The total buffer size needed; if greater than resultLength, * the output was truncated. * @stable ICU 2.0 */ U_STABLE int32_t U_EXPORT2 umsg_vformat( const UMessageFormat *fmt, UChar *result, int32_t resultLength, va_list ap, UErrorCode *status); /** * Parse a message. * For numeric arguments, this function will always use doubles. Integer types * should not be passed. * This function is not able to parse all output from {@link #umsg_format }. * @param fmt The formatter to use * @param source The text to parse. * @param sourceLength The length of source, or -1 if null-terminated. * @param count Output param to receive number of elements returned. * @param status A pointer to an UErrorCode to receive any errors * @param ... A variable-length argument list containing the arguments * specified in pattern. * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 umsg_parse( const UMessageFormat *fmt, const UChar *source, int32_t sourceLength, int32_t *count, UErrorCode *status, ...); /** * Parse a message. * For numeric arguments, this function will always use doubles. Integer types * should not be passed. * This function is not able to parse all output from {@link #umsg_format }. * @param fmt The formatter to use * @param source The text to parse. * @param sourceLength The length of source, or -1 if null-terminated. * @param count Output param to receive number of elements returned. * @param ap A variable-length argument list containing the arguments * @param status A pointer to an UErrorCode to receive any errors * specified in pattern. * @see u_formatMessage * @stable ICU 2.0 */ U_STABLE void U_EXPORT2 umsg_vparse(const UMessageFormat *fmt, const UChar *source, int32_t sourceLength, int32_t *count, va_list ap, UErrorCode *status); /** * Convert an 'apostrophe-friendly' pattern into a standard * pattern. Standard patterns treat all apostrophes as * quotes, which is problematic in some languages, e.g. * French, where apostrophe is commonly used. This utility * assumes that only an unpaired apostrophe immediately before * a brace is a true quote. Other unpaired apostrophes are paired, * and the resulting standard pattern string is returned. * * <p><b>Note</b> it is not guaranteed that the returned pattern * is indeed a valid pattern. The only effect is to convert * between patterns having different quoting semantics. * * @param pattern the 'apostrophe-friendly' patttern to convert * @param patternLength the length of pattern, or -1 if unknown and pattern is null-terminated * @param dest the buffer for the result, or NULL if preflight only * @param destCapacity the length of the buffer, or 0 if preflighting * @param ec the error code * @return the length of the resulting text, not including trailing null * if buffer has room for the trailing null, it is provided, otherwise * not * @stable ICU 3.4 */ U_STABLE int32_t U_EXPORT2 umsg_autoQuoteApostrophe(const UChar* pattern, int32_t patternLength, UChar* dest, int32_t destCapacity, UErrorCode* ec); #endif /* #if !UCONFIG_NO_FORMATTING */ #endif
SILENT KILLER Tool