00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef UMSG_H
00021 #define UMSG_H
00022
00023 #include "unicode/utypes.h"
00024
00025 #if !UCONFIG_NO_FORMATTING
00026
00027 #include "unicode/localpointer.h"
00028 #include "unicode/uloc.h"
00029 #include "unicode/parseerr.h"
00030 #include <stdarg.h>
00031
00178 U_STABLE int32_t U_EXPORT2
00179 u_formatMessage(const char *locale,
00180 const UChar *pattern,
00181 int32_t patternLength,
00182 UChar *result,
00183 int32_t resultLength,
00184 UErrorCode *status,
00185 ...);
00186
00205 U_STABLE int32_t U_EXPORT2
00206 u_vformatMessage( const char *locale,
00207 const UChar *pattern,
00208 int32_t patternLength,
00209 UChar *result,
00210 int32_t resultLength,
00211 va_list ap,
00212 UErrorCode *status);
00213
00230 U_STABLE void U_EXPORT2
00231 u_parseMessage( const char *locale,
00232 const UChar *pattern,
00233 int32_t patternLength,
00234 const UChar *source,
00235 int32_t sourceLength,
00236 UErrorCode *status,
00237 ...);
00238
00255 U_STABLE void U_EXPORT2
00256 u_vparseMessage(const char *locale,
00257 const UChar *pattern,
00258 int32_t patternLength,
00259 const UChar *source,
00260 int32_t sourceLength,
00261 va_list ap,
00262 UErrorCode *status);
00263
00284 U_STABLE int32_t U_EXPORT2
00285 u_formatMessageWithError( const char *locale,
00286 const UChar *pattern,
00287 int32_t patternLength,
00288 UChar *result,
00289 int32_t resultLength,
00290 UParseError *parseError,
00291 UErrorCode *status,
00292 ...);
00293
00313 U_STABLE int32_t U_EXPORT2
00314 u_vformatMessageWithError( const char *locale,
00315 const UChar *pattern,
00316 int32_t patternLength,
00317 UChar *result,
00318 int32_t resultLength,
00319 UParseError* parseError,
00320 va_list ap,
00321 UErrorCode *status);
00322
00341 U_STABLE void U_EXPORT2
00342 u_parseMessageWithError(const char *locale,
00343 const UChar *pattern,
00344 int32_t patternLength,
00345 const UChar *source,
00346 int32_t sourceLength,
00347 UParseError *parseError,
00348 UErrorCode *status,
00349 ...);
00350
00369 U_STABLE void U_EXPORT2
00370 u_vparseMessageWithError(const char *locale,
00371 const UChar *pattern,
00372 int32_t patternLength,
00373 const UChar *source,
00374 int32_t sourceLength,
00375 va_list ap,
00376 UParseError *parseError,
00377 UErrorCode* status);
00378
00379
00384 typedef void* UMessageFormat;
00385
00386
00399 U_STABLE UMessageFormat* U_EXPORT2
00400 umsg_open( const UChar *pattern,
00401 int32_t patternLength,
00402 const char *locale,
00403 UParseError *parseError,
00404 UErrorCode *status);
00405
00412 U_STABLE void U_EXPORT2
00413 umsg_close(UMessageFormat* format);
00414
00415 #if U_SHOW_CPLUSPLUS_API
00416
00417 U_NAMESPACE_BEGIN
00418
00428 U_DEFINE_LOCAL_OPEN_POINTER(LocalUMessageFormatPointer, UMessageFormat, umsg_close);
00429
00430 U_NAMESPACE_END
00431
00432 #endif
00433
00442 U_STABLE UMessageFormat U_EXPORT2
00443 umsg_clone(const UMessageFormat *fmt,
00444 UErrorCode *status);
00445
00453 U_STABLE void U_EXPORT2
00454 umsg_setLocale(UMessageFormat *fmt,
00455 const char* locale);
00456
00464 U_STABLE const char* U_EXPORT2
00465 umsg_getLocale(const UMessageFormat *fmt);
00466
00479 U_STABLE void U_EXPORT2
00480 umsg_applyPattern( UMessageFormat *fmt,
00481 const UChar* pattern,
00482 int32_t patternLength,
00483 UParseError* parseError,
00484 UErrorCode* status);
00485
00497 U_STABLE int32_t U_EXPORT2
00498 umsg_toPattern(const UMessageFormat *fmt,
00499 UChar* result,
00500 int32_t resultLength,
00501 UErrorCode* status);
00502
00518 U_STABLE int32_t U_EXPORT2
00519 umsg_format( const UMessageFormat *fmt,
00520 UChar *result,
00521 int32_t resultLength,
00522 UErrorCode *status,
00523 ...);
00524
00540 U_STABLE int32_t U_EXPORT2
00541 umsg_vformat( const UMessageFormat *fmt,
00542 UChar *result,
00543 int32_t resultLength,
00544 va_list ap,
00545 UErrorCode *status);
00546
00561 U_STABLE void U_EXPORT2
00562 umsg_parse( const UMessageFormat *fmt,
00563 const UChar *source,
00564 int32_t sourceLength,
00565 int32_t *count,
00566 UErrorCode *status,
00567 ...);
00568
00584 U_STABLE void U_EXPORT2
00585 umsg_vparse(const UMessageFormat *fmt,
00586 const UChar *source,
00587 int32_t sourceLength,
00588 int32_t *count,
00589 va_list ap,
00590 UErrorCode *status);
00591
00592
00616 U_STABLE int32_t U_EXPORT2
00617 umsg_autoQuoteApostrophe(const UChar* pattern,
00618 int32_t patternLength,
00619 UChar* dest,
00620 int32_t destCapacity,
00621 UErrorCode* ec);
00622
00623 #endif
00624
00625 #endif