2 *******************************************************************************
3 * Copyright (C) 2011, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 *******************************************************************************
6 * file name: messageimpl.h
8 * tab size: 8 (not used)
11 * created on: 2011apr04
12 * created by: Markus W. Scherer
15 #ifndef __MESSAGEIMPL_H__
16 #define __MESSAGEIMPL_H__
18 #include "unicode/utypes.h"
20 #if !UCONFIG_NO_FORMATTING
22 #include "unicode/messagepattern.h"
27 * Helper functions for use of MessagePattern.
28 * In Java, these are package-private methods in MessagePattern itself.
29 * In C++, they are declared here and implemented in messagepattern.cpp.
31 class U_COMMON_API MessageImpl
{
34 * @return TRUE if getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED
36 static UBool
jdkAposMode(const MessagePattern
&msgPattern
) {
37 return msgPattern
.getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED
;
41 * Appends the s[start, limit[ substring to sb, but with only half of the apostrophes
42 * according to JDK pattern behavior.
44 static void appendReducedApostrophes(const UnicodeString
&s
, int32_t start
, int32_t limit
,
48 * Appends the sub-message to the result string.
49 * Omits SKIP_SYNTAX and appends whole arguments using appendReducedApostrophes().
51 static UnicodeString
&appendSubMessageWithoutSkipSyntax(const MessagePattern
&msgPattern
,
53 UnicodeString
&result
);
56 MessageImpl(); // no constructor: all static methods
61 #endif // !UCONFIG_NO_FORMATTING
63 #endif // __MESSAGEIMPL_H__