intl/icu/source/common/messageimpl.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/common/messageimpl.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,63 @@
     1.4 +/*
     1.5 +*******************************************************************************
     1.6 +*   Copyright (C) 2011, International Business Machines
     1.7 +*   Corporation and others.  All Rights Reserved.
     1.8 +*******************************************************************************
     1.9 +*   file name:  messageimpl.h
    1.10 +*   encoding:   US-ASCII
    1.11 +*   tab size:   8 (not used)
    1.12 +*   indentation:4
    1.13 +*
    1.14 +*   created on: 2011apr04
    1.15 +*   created by: Markus W. Scherer
    1.16 +*/
    1.17 +
    1.18 +#ifndef __MESSAGEIMPL_H__
    1.19 +#define __MESSAGEIMPL_H__
    1.20 +
    1.21 +#include "unicode/utypes.h"
    1.22 +
    1.23 +#if !UCONFIG_NO_FORMATTING
    1.24 +
    1.25 +#include "unicode/messagepattern.h"
    1.26 +
    1.27 +U_NAMESPACE_BEGIN
    1.28 +
    1.29 +/**
    1.30 + * Helper functions for use of MessagePattern.
    1.31 + * In Java, these are package-private methods in MessagePattern itself.
    1.32 + * In C++, they are declared here and implemented in messagepattern.cpp.
    1.33 + */
    1.34 +class U_COMMON_API MessageImpl {
    1.35 +public:
    1.36 +    /**
    1.37 +     * @return TRUE if getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED
    1.38 +     */
    1.39 +    static UBool jdkAposMode(const MessagePattern &msgPattern) {
    1.40 +        return msgPattern.getApostropheMode()==UMSGPAT_APOS_DOUBLE_REQUIRED;
    1.41 +    }
    1.42 +
    1.43 +    /**
    1.44 +     * Appends the s[start, limit[ substring to sb, but with only half of the apostrophes
    1.45 +     * according to JDK pattern behavior.
    1.46 +     */
    1.47 +    static void appendReducedApostrophes(const UnicodeString &s, int32_t start, int32_t limit,
    1.48 +                                         UnicodeString &sb);
    1.49 +
    1.50 +    /**
    1.51 +     * Appends the sub-message to the result string.
    1.52 +     * Omits SKIP_SYNTAX and appends whole arguments using appendReducedApostrophes().
    1.53 +     */
    1.54 +    static UnicodeString &appendSubMessageWithoutSkipSyntax(const MessagePattern &msgPattern,
    1.55 +                                                            int32_t msgStart,
    1.56 +                                                            UnicodeString &result);
    1.57 +
    1.58 +private:
    1.59 +    MessageImpl();  // no constructor: all static methods
    1.60 +};
    1.61 +
    1.62 +U_NAMESPACE_END
    1.63 +
    1.64 +#endif  // !UCONFIG_NO_FORMATTING
    1.65 +
    1.66 +#endif  // __MESSAGEIMPL_H__

mercurial