ICU 73.2  73.2
umsg.h
Go to the documentation of this file.
00001 // © 2016 and later: Unicode, Inc. and others.
00002 // License & terms of use: http://www.unicode.org/copyright.html
00003 /********************************************************************
00004  * COPYRIGHT: 
00005  * Copyright (c) 1997-2011, International Business Machines Corporation and
00006  * others. All Rights Reserved.
00007  * Copyright (C) 2010 , Yahoo! Inc. 
00008  ********************************************************************
00009  *
00010  *   file name:  umsg.h
00011  *   encoding:   UTF-8
00012  *   tab size:   8 (not used)
00013  *   indentation:4
00014  *
00015  *   Change history:
00016  *
00017  *   08/5/2001  Ram         Added C wrappers for C++ API.
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/uloc.h"
00028 #include "unicode/parseerr.h"
00029 #include <stdarg.h>
00030 
00031 #if U_SHOW_CPLUSPLUS_API
00032 #include "unicode/localpointer.h"
00033 #endif   // U_SHOW_CPLUSPLUS_API
00034 
00181 U_CAPI int32_t U_EXPORT2 
00182 u_formatMessage(const char  *locale,
00183                  const UChar *pattern,
00184                 int32_t     patternLength,
00185                 UChar       *result,
00186                 int32_t     resultLength,
00187                 UErrorCode  *status,
00188                 ...);
00189 
00208 U_CAPI int32_t U_EXPORT2 
00209 u_vformatMessage(   const char  *locale,
00210                     const UChar *pattern,
00211                     int32_t     patternLength,
00212                     UChar       *result,
00213                     int32_t     resultLength,
00214                     va_list     ap,
00215                     UErrorCode  *status);
00216 
00233 U_CAPI void U_EXPORT2 
00234 u_parseMessage( const char   *locale,
00235                 const UChar  *pattern,
00236                 int32_t      patternLength,
00237                 const UChar  *source,
00238                 int32_t      sourceLength,
00239                 UErrorCode   *status,
00240                 ...);
00241 
00258 U_CAPI void U_EXPORT2 
00259 u_vparseMessage(const char  *locale,
00260                 const UChar *pattern,
00261                 int32_t     patternLength,
00262                 const UChar *source,
00263                 int32_t     sourceLength,
00264                 va_list     ap,
00265                 UErrorCode  *status);
00266 
00287 U_CAPI int32_t U_EXPORT2 
00288 u_formatMessageWithError(   const char    *locale,
00289                             const UChar   *pattern,
00290                             int32_t       patternLength,
00291                             UChar         *result,
00292                             int32_t       resultLength,
00293                             UParseError   *parseError,
00294                             UErrorCode    *status,
00295                             ...);
00296 
00316 U_CAPI int32_t U_EXPORT2 
00317 u_vformatMessageWithError(  const char   *locale,
00318                             const UChar  *pattern,
00319                             int32_t      patternLength,
00320                             UChar        *result,
00321                             int32_t      resultLength,
00322                             UParseError* parseError,
00323                             va_list      ap,
00324                             UErrorCode   *status);
00325 
00344 U_CAPI void U_EXPORT2 
00345 u_parseMessageWithError(const char  *locale,
00346                         const UChar *pattern,
00347                         int32_t     patternLength,
00348                         const UChar *source,
00349                         int32_t     sourceLength,
00350                         UParseError *parseError,
00351                         UErrorCode  *status,
00352                         ...);
00353 
00372 U_CAPI void U_EXPORT2 
00373 u_vparseMessageWithError(const char  *locale,
00374                          const UChar *pattern,
00375                          int32_t     patternLength,
00376                          const UChar *source,
00377                          int32_t     sourceLength,
00378                          va_list     ap,
00379                          UParseError *parseError,
00380                          UErrorCode* status);
00381 
00382 /*----------------------- New experimental API --------------------------- */
00387 typedef void* UMessageFormat;
00388 
00389 
00402 U_CAPI UMessageFormat* U_EXPORT2 
00403 umsg_open(  const UChar     *pattern,
00404             int32_t         patternLength,
00405             const  char     *locale,
00406             UParseError     *parseError,
00407             UErrorCode      *status);
00408 
00415 U_CAPI void U_EXPORT2 
00416 umsg_close(UMessageFormat* format);
00417 
00418 #if U_SHOW_CPLUSPLUS_API
00419 
00420 U_NAMESPACE_BEGIN
00421 
00431 U_DEFINE_LOCAL_OPEN_POINTER(LocalUMessageFormatPointer, UMessageFormat, umsg_close);
00432 
00433 U_NAMESPACE_END
00434 
00435 #endif
00436 
00445 U_CAPI UMessageFormat U_EXPORT2 
00446 umsg_clone(const UMessageFormat *fmt,
00447            UErrorCode *status);
00448 
00456 U_CAPI void  U_EXPORT2 
00457 umsg_setLocale(UMessageFormat *fmt,
00458                const char* locale);
00459 
00467 U_CAPI const char*  U_EXPORT2 
00468 umsg_getLocale(const UMessageFormat *fmt);
00469 
00482 U_CAPI void  U_EXPORT2 
00483 umsg_applyPattern( UMessageFormat *fmt,
00484                    const UChar* pattern,
00485                    int32_t patternLength,
00486                    UParseError* parseError,
00487                    UErrorCode* status);
00488 
00500 U_CAPI int32_t  U_EXPORT2 
00501 umsg_toPattern(const UMessageFormat *fmt,
00502                UChar* result, 
00503                int32_t resultLength,
00504                UErrorCode* status);
00505 
00521 U_CAPI int32_t U_EXPORT2 
00522 umsg_format(    const UMessageFormat *fmt,
00523                 UChar          *result,
00524                 int32_t        resultLength,
00525                 UErrorCode     *status,
00526                 ...);
00527 
00543 U_CAPI int32_t U_EXPORT2 
00544 umsg_vformat(   const UMessageFormat *fmt,
00545                 UChar          *result,
00546                 int32_t        resultLength,
00547                 va_list        ap,
00548                 UErrorCode     *status);
00549 
00564 U_CAPI void U_EXPORT2 
00565 umsg_parse( const UMessageFormat *fmt,
00566             const UChar    *source,
00567             int32_t        sourceLength,
00568             int32_t        *count,
00569             UErrorCode     *status,
00570             ...);
00571 
00587 U_CAPI void U_EXPORT2 
00588 umsg_vparse(const UMessageFormat *fmt,
00589             const UChar    *source,
00590             int32_t        sourceLength,
00591             int32_t        *count,
00592             va_list        ap,
00593             UErrorCode     *status);
00594 
00595 
00619 U_CAPI int32_t U_EXPORT2 
00620 umsg_autoQuoteApostrophe(const UChar* pattern, 
00621                          int32_t patternLength,
00622                          UChar* dest,
00623                          int32_t destCapacity,
00624                          UErrorCode* ec);
00625 
00626 #endif /* #if !UCONFIG_NO_FORMATTING */
00627 
00628 #endif