ICU 4.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
umsg.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (C) 1996-2006, International Business Machines Corporation
4 * and others. All Rights Reserved.
5 *******************************************************************************
6 *
7 * file name: umsg.h
8 * encoding: US-ASCII
9 * tab size: 8 (not used)
10 * indentation:4
11 *
12 * Change history:
13 *
14 * 08/5/2001 Ram Added C wrappers for C++ API.
15 *
16 *
17 */
18 
19 #ifndef UMSG_H
20 #define UMSG_H
21 
22 #include "unicode/utypes.h"
23 
24 #if !UCONFIG_NO_FORMATTING
25 
26 #include "unicode/uloc.h"
27 #include "unicode/parseerr.h"
28 #include <stdarg.h>
220 u_formatMessage(const char *locale,
221  const UChar *pattern,
222  int32_t patternLength,
223  UChar *result,
224  int32_t resultLength,
225  UErrorCode *status,
226  ...);
227 
247 u_vformatMessage( const char *locale,
248  const UChar *pattern,
249  int32_t patternLength,
250  UChar *result,
251  int32_t resultLength,
252  va_list ap,
253  UErrorCode *status);
254 
271 U_STABLE void U_EXPORT2
272 u_parseMessage( const char *locale,
273  const UChar *pattern,
274  int32_t patternLength,
275  const UChar *source,
276  int32_t sourceLength,
277  UErrorCode *status,
278  ...);
279 
296 U_STABLE void U_EXPORT2
297 u_vparseMessage(const char *locale,
298  const UChar *pattern,
299  int32_t patternLength,
300  const UChar *source,
301  int32_t sourceLength,
302  va_list ap,
303  UErrorCode *status);
304 
326 u_formatMessageWithError( const char *locale,
327  const UChar *pattern,
328  int32_t patternLength,
329  UChar *result,
330  int32_t resultLength,
331  UParseError *parseError,
332  UErrorCode *status,
333  ...);
334 
355 u_vformatMessageWithError( const char *locale,
356  const UChar *pattern,
357  int32_t patternLength,
358  UChar *result,
359  int32_t resultLength,
360  UParseError* parseError,
361  va_list ap,
362  UErrorCode *status);
363 
382 U_STABLE void U_EXPORT2
383 u_parseMessageWithError(const char *locale,
384  const UChar *pattern,
385  int32_t patternLength,
386  const UChar *source,
387  int32_t sourceLength,
388  UParseError *parseError,
389  UErrorCode *status,
390  ...);
391 
410 U_STABLE void U_EXPORT2
411 u_vparseMessageWithError(const char *locale,
412  const UChar *pattern,
413  int32_t patternLength,
414  const UChar *source,
415  int32_t sourceLength,
416  va_list ap,
417  UParseError *parseError,
418  UErrorCode* status);
419 
420 /*----------------------- New experimental API --------------------------- */
425 typedef void* UMessageFormat;
426 
427 
441 umsg_open( const UChar *pattern,
442  int32_t patternLength,
443  const char *locale,
444  UParseError *parseError,
445  UErrorCode *status);
446 
453 U_STABLE void U_EXPORT2
454 umsg_close(UMessageFormat* format);
455 
465 umsg_clone(const UMessageFormat *fmt,
466  UErrorCode *status);
467 
475 U_STABLE void U_EXPORT2
477  const char* locale);
478 
486 U_STABLE const char* U_EXPORT2
487 umsg_getLocale(const UMessageFormat *fmt);
488 
501 U_STABLE void U_EXPORT2
503  const UChar* pattern,
504  int32_t patternLength,
505  UParseError* parseError,
506  UErrorCode* status);
507 
520 umsg_toPattern(const UMessageFormat *fmt,
521  UChar* result,
522  int32_t resultLength,
523  UErrorCode* status);
524 
541 umsg_format( const UMessageFormat *fmt,
542  UChar *result,
543  int32_t resultLength,
544  UErrorCode *status,
545  ...);
546 
563 umsg_vformat( const UMessageFormat *fmt,
564  UChar *result,
565  int32_t resultLength,
566  va_list ap,
567  UErrorCode *status);
568 
583 U_STABLE void U_EXPORT2
584 umsg_parse( const UMessageFormat *fmt,
585  const UChar *source,
586  int32_t sourceLength,
587  int32_t *count,
588  UErrorCode *status,
589  ...);
590 
606 U_STABLE void U_EXPORT2
607 umsg_vparse(const UMessageFormat *fmt,
608  const UChar *source,
609  int32_t sourceLength,
610  int32_t *count,
611  va_list ap,
612  UErrorCode *status);
613 
614 
639 umsg_autoQuoteApostrophe(const UChar* pattern,
640  int32_t patternLength,
641  UChar* dest,
642  int32_t destCapacity,
643  UErrorCode* ec);
644 
645 #endif /* #if !UCONFIG_NO_FORMATTING */
646 
647 #endif
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.
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.
void umsg_parse(const UMessageFormat *fmt, const UChar *source, int32_t sourceLength, int32_t *count, UErrorCode *status,...)
Parse a message.
int32_t umsg_autoQuoteApostrophe(const UChar *pattern, int32_t patternLength, UChar *dest, int32_t destCapacity, UErrorCode *ec)
Convert an &#39;apostrophe-friendly&#39; pattern into a standard pattern.
const char * umsg_getLocale(const UMessageFormat *fmt)
Gets the locale.
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.
int32_t umsg_vformat(const UMessageFormat *fmt, UChar *result, int32_t resultLength, va_list ap, UErrorCode *status)
Format a message for a locale.
void u_parseMessage(const char *locale, const UChar *pattern, int32_t patternLength, const UChar *source, int32_t sourceLength, UErrorCode *status,...)
Parse a message.
void umsg_close(UMessageFormat *format)
Close a UMessageFormat.
void umsg_vparse(const UMessageFormat *fmt, const UChar *source, int32_t sourceLength, int32_t *count, va_list ap, UErrorCode *status)
Parse a message.
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.
void * UMessageFormat
The message format object.
Definition: umsg.h:425
int32_t umsg_toPattern(const UMessageFormat *fmt, UChar *result, int32_t resultLength, UErrorCode *status)
Gets the pattern.
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.
void umsg_setLocale(UMessageFormat *fmt, const char *locale)
Sets the locale.
int32_t umsg_format(const UMessageFormat *fmt, UChar *result, int32_t resultLength, UErrorCode *status,...)
Format a message for a locale.
UMessageFormat umsg_clone(const UMessageFormat *fmt, UErrorCode *status)
Open a copy of a UMessageFormat.
#define U_EXPORT2
Definition: platform.h:338
uint16_t UChar
Define UChar to be wchar_t if that is 16 bits wide; always assumed to be unsigned.
Definition: umachine.h:299
C API: Parse Error Information.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:593
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.
A UParseError struct is used to returned detailed information about parsing errors.
Definition: parseerr.h:56
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.
Basic definitions for ICU, for both C and C++ APIs.
void umsg_applyPattern(UMessageFormat *fmt, const UChar *pattern, int32_t patternLength, UParseError *parseError, UErrorCode *status)
Sets the pattern.
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.
signed int int32_t
Define 64 bit limits.
Definition: pwin32.h:143
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:117
C API: Locale.