michael@0: /* michael@0: ******************************************************************************* michael@0: * Copyright (C) 2011, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: ******************************************************************************* michael@0: * file name: messageimpl.h michael@0: * encoding: US-ASCII michael@0: * tab size: 8 (not used) michael@0: * indentation:4 michael@0: * michael@0: * created on: 2011apr04 michael@0: * created by: Markus W. Scherer michael@0: */ michael@0: michael@0: #ifndef __MESSAGEIMPL_H__ michael@0: #define __MESSAGEIMPL_H__ michael@0: michael@0: #include "unicode/utypes.h" michael@0: michael@0: #if !UCONFIG_NO_FORMATTING michael@0: michael@0: #include "unicode/messagepattern.h" michael@0: michael@0: U_NAMESPACE_BEGIN michael@0: michael@0: /** michael@0: * Helper functions for use of MessagePattern. michael@0: * In Java, these are package-private methods in MessagePattern itself. michael@0: * In C++, they are declared here and implemented in messagepattern.cpp. michael@0: */ michael@0: class U_COMMON_API MessageImpl { michael@0: public: michael@0: /** michael@0: * @return TRUE if getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED michael@0: */ michael@0: static UBool jdkAposMode(const MessagePattern &msgPattern) { michael@0: return msgPattern.getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED; michael@0: } michael@0: michael@0: /** michael@0: * Appends the s[start, limit[ substring to sb, but with only half of the apostrophes michael@0: * according to JDK pattern behavior. michael@0: */ michael@0: static void appendReducedApostrophes(const UnicodeString &s, int32_t start, int32_t limit, michael@0: UnicodeString &sb); michael@0: michael@0: /** michael@0: * Appends the sub-message to the result string. michael@0: * Omits SKIP_SYNTAX and appends whole arguments using appendReducedApostrophes(). michael@0: */ michael@0: static UnicodeString &appendSubMessageWithoutSkipSyntax(const MessagePattern &msgPattern, michael@0: int32_t msgStart, michael@0: UnicodeString &result); michael@0: michael@0: private: michael@0: MessageImpl(); // no constructor: all static methods michael@0: }; michael@0: michael@0: U_NAMESPACE_END michael@0: michael@0: #endif // !UCONFIG_NO_FORMATTING michael@0: michael@0: #endif // __MESSAGEIMPL_H__