Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | /* |
michael@0 | 2 | ******************************************************************************* |
michael@0 | 3 | * Copyright (C) 2011, International Business Machines |
michael@0 | 4 | * Corporation and others. All Rights Reserved. |
michael@0 | 5 | ******************************************************************************* |
michael@0 | 6 | * file name: messageimpl.h |
michael@0 | 7 | * encoding: US-ASCII |
michael@0 | 8 | * tab size: 8 (not used) |
michael@0 | 9 | * indentation:4 |
michael@0 | 10 | * |
michael@0 | 11 | * created on: 2011apr04 |
michael@0 | 12 | * created by: Markus W. Scherer |
michael@0 | 13 | */ |
michael@0 | 14 | |
michael@0 | 15 | #ifndef __MESSAGEIMPL_H__ |
michael@0 | 16 | #define __MESSAGEIMPL_H__ |
michael@0 | 17 | |
michael@0 | 18 | #include "unicode/utypes.h" |
michael@0 | 19 | |
michael@0 | 20 | #if !UCONFIG_NO_FORMATTING |
michael@0 | 21 | |
michael@0 | 22 | #include "unicode/messagepattern.h" |
michael@0 | 23 | |
michael@0 | 24 | U_NAMESPACE_BEGIN |
michael@0 | 25 | |
michael@0 | 26 | /** |
michael@0 | 27 | * Helper functions for use of MessagePattern. |
michael@0 | 28 | * In Java, these are package-private methods in MessagePattern itself. |
michael@0 | 29 | * In C++, they are declared here and implemented in messagepattern.cpp. |
michael@0 | 30 | */ |
michael@0 | 31 | class U_COMMON_API MessageImpl { |
michael@0 | 32 | public: |
michael@0 | 33 | /** |
michael@0 | 34 | * @return TRUE if getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED |
michael@0 | 35 | */ |
michael@0 | 36 | static UBool jdkAposMode(const MessagePattern &msgPattern) { |
michael@0 | 37 | return msgPattern.getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED; |
michael@0 | 38 | } |
michael@0 | 39 | |
michael@0 | 40 | /** |
michael@0 | 41 | * Appends the s[start, limit[ substring to sb, but with only half of the apostrophes |
michael@0 | 42 | * according to JDK pattern behavior. |
michael@0 | 43 | */ |
michael@0 | 44 | static void appendReducedApostrophes(const UnicodeString &s, int32_t start, int32_t limit, |
michael@0 | 45 | UnicodeString &sb); |
michael@0 | 46 | |
michael@0 | 47 | /** |
michael@0 | 48 | * Appends the sub-message to the result string. |
michael@0 | 49 | * Omits SKIP_SYNTAX and appends whole arguments using appendReducedApostrophes(). |
michael@0 | 50 | */ |
michael@0 | 51 | static UnicodeString &appendSubMessageWithoutSkipSyntax(const MessagePattern &msgPattern, |
michael@0 | 52 | int32_t msgStart, |
michael@0 | 53 | UnicodeString &result); |
michael@0 | 54 | |
michael@0 | 55 | private: |
michael@0 | 56 | MessageImpl(); // no constructor: all static methods |
michael@0 | 57 | }; |
michael@0 | 58 | |
michael@0 | 59 | U_NAMESPACE_END |
michael@0 | 60 | |
michael@0 | 61 | #endif // !UCONFIG_NO_FORMATTING |
michael@0 | 62 | |
michael@0 | 63 | #endif // __MESSAGEIMPL_H__ |