1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 *******************************************************************************
5 * Copyright (C) 2011, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 *******************************************************************************
8 * file name: messageimpl.h
10 * tab size: 8 (not used)
13 * created on: 2011apr04
14 * created by: Markus W. Scherer
17 #ifndef __MESSAGEIMPL_H__
18 #define __MESSAGEIMPL_H__
20 #include "unicode/utypes.h"
22 #if !UCONFIG_NO_FORMATTING
24 #include "unicode/messagepattern.h"
29 * Helper functions for use of MessagePattern.
30 * In Java, these are package-private methods in MessagePattern itself.
31 * In C++, they are declared here and implemented in messagepattern.cpp.
33 class U_COMMON_API MessageImpl
{
36 * @return TRUE if getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED
38 static UBool
jdkAposMode(const MessagePattern
&msgPattern
) {
39 return msgPattern
.getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED
;
43 * Appends the s[start, limit[ substring to sb, but with only half of the apostrophes
44 * according to JDK pattern behavior.
46 static void appendReducedApostrophes(const UnicodeString
&s
, int32_t start
, int32_t limit
,
50 * Appends the sub-message to the result string.
51 * Omits SKIP_SYNTAX and appends whole arguments using appendReducedApostrophes().
53 static UnicodeString
&appendSubMessageWithoutSkipSyntax(const MessagePattern
&msgPattern
,
55 UnicodeString
&result
);
58 MessageImpl(); // no constructor: all static methods
63 #endif // !UCONFIG_NO_FORMATTING
65 #endif // __MESSAGEIMPL_H__