ICU 56.1: umsg.h Source File

ICU 56.1 56.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

umsg.h
Go to the documentation of this file.
1 /********************************************************************
2 * COPYRIGHT:
3 * Copyright (c) 1997-2011, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 * Copyright (C) 2010 , Yahoo! Inc.
6 ********************************************************************
7 *
8 * file name: umsg.h
9 * encoding: US-ASCII
10 * tab size: 8 (not used)
11 * indentation:4
12 *
13 * Change history:
14 *
15 * 08/5/2001 Ram Added C wrappers for C++ API.
16 ********************************************************************/
17
18 #ifndef UMSG_H
19 #define UMSG_H
20
21 #include "unicode/utypes.h"
22
23 #if !UCONFIG_NO_FORMATTING
24
25 #include "unicode/localpointer.h"
26 #include "unicode/uloc.h"
27 #include "unicode/parseerr.h"
28 #include <stdarg.h>
29
176 U_STABLE int32_t U_EXPORT2
177 u_formatMessage(const char *locale,
178 const UChar *pattern,
179 int32_t patternLength,
180 UChar *result,
181 int32_t resultLength,
182 UErrorCode *status,
183 ...);
184
203 U_STABLE int32_t U_EXPORT2
204 u_vformatMessage( const char *locale,
205 const UChar *pattern,
206 int32_t patternLength,
207 UChar *result,
208 int32_t resultLength,
209 va_list ap,
210 UErrorCode *status);
211
228 U_STABLE void U_EXPORT2
229 u_parseMessage( const char *locale,
230 const UChar *pattern,
231 int32_t patternLength,
232 const UChar *source,
233 int32_t sourceLength,
234 UErrorCode *status,
235 ...);
236
253 U_STABLE void U_EXPORT2
254 u_vparseMessage(const char *locale,
255 const UChar *pattern,
256 int32_t patternLength,
257 const UChar *source,
258 int32_t sourceLength,
259 va_list ap,
260 UErrorCode *status);
261
282 U_STABLE int32_t U_EXPORT2
283 u_formatMessageWithError( const char *locale,
284 const UChar *pattern,
285 int32_t patternLength,
286 UChar *result,
287 int32_t resultLength,
288 UParseError *parseError,
289 UErrorCode *status,
290 ...);
291
311 U_STABLE int32_t U_EXPORT2
312 u_vformatMessageWithError( const char *locale,
313 const UChar *pattern,
314 int32_t patternLength,
315 UChar *result,
316 int32_t resultLength,
317 UParseError* parseError,
318 va_list ap,
319 UErrorCode *status);
320
339 U_STABLE void U_EXPORT2
340 u_parseMessageWithError(const char *locale,
341 const UChar *pattern,
342 int32_t patternLength,
343 const UChar *source,
344 int32_t sourceLength,
345 UParseError *parseError,
346 UErrorCode *status,
347 ...);
348
367 U_STABLE void U_EXPORT2
368 u_vparseMessageWithError(const char *locale,
369 const UChar *pattern,
370 int32_t patternLength,
371 const UChar *source,
372 int32_t sourceLength,
373 va_list ap,
374 UParseError *parseError,
375 UErrorCode* status);
376
377 /*----------------------- New experimental API --------------------------- */
382 typedef void* UMessageFormat;
383
384
397 U_STABLE UMessageFormat* U_EXPORT2
398 umsg_open( const UChar *pattern,
399 int32_t patternLength,
400 const char *locale,
401 UParseError *parseError,
402 UErrorCode *status);
403
410 U_STABLE void U_EXPORT2
411 umsg_close(UMessageFormat* format);
412
413 #if U_SHOW_CPLUSPLUS_API
414
415 U_NAMESPACE_BEGIN
416
426 U_DEFINE_LOCAL_OPEN_POINTER(LocalUMessageFormatPointer, UMessageFormat, umsg_close);
427
428 U_NAMESPACE_END
429
430 #endif
431
440 U_STABLE UMessageFormat U_EXPORT2
441 umsg_clone(const UMessageFormat *fmt,
442 UErrorCode *status);
443
451 U_STABLE void U_EXPORT2
452 umsg_setLocale(UMessageFormat *fmt,
453 const char* locale);
454
462 U_STABLE const char* U_EXPORT2
463 umsg_getLocale(const UMessageFormat *fmt);
464
477 U_STABLE void U_EXPORT2
478 umsg_applyPattern( UMessageFormat *fmt,
479 const UChar* pattern,
480 int32_t patternLength,
481 UParseError* parseError,
482 UErrorCode* status);
483
495 U_STABLE int32_t U_EXPORT2
496 umsg_toPattern(const UMessageFormat *fmt,
497 UChar* result,
498 int32_t resultLength,
499 UErrorCode* status);
500
516 U_STABLE int32_t U_EXPORT2
517 umsg_format( const UMessageFormat *fmt,
518 UChar *result,
519 int32_t resultLength,
520 UErrorCode *status,
521 ...);
522
538 U_STABLE int32_t U_EXPORT2
539 umsg_vformat( const UMessageFormat *fmt,
540 UChar *result,
541 int32_t resultLength,
542 va_list ap,
543 UErrorCode *status);
544
559 U_STABLE void U_EXPORT2
560 umsg_parse( const UMessageFormat *fmt,
561 const UChar *source,
562 int32_t sourceLength,
563 int32_t *count,
564 UErrorCode *status,
565 ...);
566
582 U_STABLE void U_EXPORT2
583 umsg_vparse(const UMessageFormat *fmt,
584 const UChar *source,
585 int32_t sourceLength,
586 int32_t *count,
587 va_list ap,
588 UErrorCode *status);
589
590
614 U_STABLE int32_t U_EXPORT2
615 umsg_autoQuoteApostrophe(const UChar* pattern,
616 int32_t patternLength,
617 UChar* dest,
618 int32_t destCapacity,
619 UErrorCode* ec);
620
621 #endif /* #if !UCONFIG_NO_FORMATTING */
622
623 #endif
u_vparseMessage
void u_vparseMessage(const char *locale, const UChar *pattern, int32_t patternLength, const UChar *source, int32_t sourceLength, va_list ap, UErrorCode *status)
Parse a message.
u_vformatMessage
int32_t u_vformatMessage(const char *locale, const UChar *pattern, int32_t patternLength, UChar *result, int32_t resultLength, va_list ap, UErrorCode *status)
Format a message for a locale.
umsg_parse
void umsg_parse(const UMessageFormat *fmt, const UChar *source, int32_t sourceLength, int32_t *count, UErrorCode *status,...)
Parse a message.
umsg_autoQuoteApostrophe
int32_t umsg_autoQuoteApostrophe(const UChar *pattern, int32_t patternLength, UChar *dest, int32_t destCapacity, UErrorCode *ec)
Convert an 'apostrophe-friendly' pattern into a standard pattern.
umsg_getLocale
const char * umsg_getLocale(const UMessageFormat *fmt)
Gets the locale.
u_vformatMessageWithError
int32_t u_vformatMessageWithError(const char *locale, const UChar *pattern, int32_t patternLength, UChar *result, int32_t resultLength, UParseError *parseError, va_list ap, UErrorCode *status)
Format a message for a locale.
umsg_vformat
int32_t umsg_vformat(const UMessageFormat *fmt, UChar *result, int32_t resultLength, va_list ap, UErrorCode *status)
Format a message for a locale.
u_parseMessage
void u_parseMessage(const char *locale, const UChar *pattern, int32_t patternLength, const UChar *source, int32_t sourceLength, UErrorCode *status,...)
Parse a message.
umsg_close
void umsg_close(UMessageFormat *format)
Close a UMessageFormat.
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
umsg_vparse
void umsg_vparse(const UMessageFormat *fmt, const UChar *source, int32_t sourceLength, int32_t *count, va_list ap, UErrorCode *status)
Parse a message.
u_formatMessageWithError
int32_t 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.
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:535
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
UMessageFormat
void * UMessageFormat
The message format object.
Definition: umsg.h:382
umsg_toPattern
int32_t umsg_toPattern(const UMessageFormat *fmt, UChar *result, int32_t resultLength, UErrorCode *status)
Gets the pattern.
umsg_open
UMessageFormat * umsg_open(const UChar *pattern, int32_t patternLength, const char *locale, UParseError *parseError, UErrorCode *status)
Open a message formatter with given pattern and for the given locale.
umsg_setLocale
void umsg_setLocale(UMessageFormat *fmt, const char *locale)
Sets the locale.
umsg_format
int32_t umsg_format(const UMessageFormat *fmt, UChar *result, int32_t resultLength, UErrorCode *status,...)
Format a message for a locale.
umsg_clone
UMessageFormat umsg_clone(const UMessageFormat *fmt, UErrorCode *status)
Open a copy of a UMessageFormat.
UChar
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition: umachine.h:312
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
parseerr.h
C API: Parse Error Information.
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
u_parseMessageWithError
void u_parseMessageWithError(const char *locale, const UChar *pattern, int32_t patternLength, const UChar *source, int32_t sourceLength, UParseError *parseError, UErrorCode *status,...)
Parse a message.
UParseError
A UParseError struct is used to returned detailed information about parsing errors.
Definition: parseerr.h:56
u_vparseMessageWithError
void u_vparseMessageWithError(const char *locale, const UChar *pattern, int32_t patternLength, const UChar *source, int32_t sourceLength, va_list ap, UParseError *parseError, UErrorCode *status)
Parse a message.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
umsg_applyPattern
void umsg_applyPattern(UMessageFormat *fmt, const UChar *pattern, int32_t patternLength, UParseError *parseError, UErrorCode *status)
Sets the pattern.
u_formatMessage
int32_t u_formatMessage(const char *locale, const UChar *pattern, int32_t patternLength, UChar *result, int32_t resultLength, UErrorCode *status,...)
Format a message for a locale.
U_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:109
LocalUMessageFormatPointer
"Smart pointer" class, closes a UMessageFormat via umsg_close().
uloc.h
C API: Locale.