chromium/third_party/icu/source/i18n/umsg.cpp

// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
*   Copyright (C) 1999-2012, International Business Machines
*   Corporation and others.  All Rights Reserved.
*
*******************************************************************************
*   file name:  umsg.cpp
*   encoding:   UTF-8
*   tab size:   8 (not used)
*   indentation:4
*
* This is a C wrapper to MessageFormat C++ API.
*
*   Change history:
*
*   08/5/2001  Ram         Added C wrappers for C++ API. Changed implementation of old API's
*                          Removed pattern parser.
* 
*/

#include "unicode/utypes.h"

#if !UCONFIG_NO_FORMATTING

#include "unicode/umsg.h"
#include "unicode/ustring.h"
#include "unicode/fmtable.h"
#include "unicode/msgfmt.h"
#include "unicode/unistr.h"
#include "cpputils.h"
#include "uassert.h"
#include "ustr_imp.h"

U_NAMESPACE_BEGIN
/**
 * This class isolates our access to private internal methods of
 * MessageFormat.  It is never instantiated; it exists only for C++
 * access management.
 */
class MessageFormatAdapter {};
const Formattable::Type*
MessageFormatAdapter::getArgTypeList(const MessageFormat& m,
                                     int32_t& count) {}
U_NAMESPACE_END

U_NAMESPACE_USE

U_CAPI int32_t
u_formatMessage(const char  *locale,
                const char16_t *pattern,
                int32_t     patternLength,
                char16_t    *result,
                int32_t     resultLength,
                UErrorCode  *status,
                ...)
{}

U_CAPI int32_t U_EXPORT2
u_vformatMessage(   const char  *locale,
                    const char16_t *pattern,
                    int32_t     patternLength,
                    char16_t    *result,
                    int32_t     resultLength,
                    va_list     ap,
                    UErrorCode  *status)

{}

U_CAPI int32_t
u_formatMessageWithError(const char *locale,
                        const char16_t *pattern,
                        int32_t     patternLength,
                        char16_t    *result,
                        int32_t     resultLength,
                        UParseError *parseError,
                        UErrorCode  *status,
                        ...)
{}

U_CAPI int32_t U_EXPORT2
u_vformatMessageWithError(  const char  *locale,
                            const char16_t *pattern,
                            int32_t     patternLength,
                            char16_t    *result,
                            int32_t     resultLength,
                            UParseError *parseError,
                            va_list     ap,
                            UErrorCode  *status)

{}


// For parse, do the reverse of format:
//  1. Call through to the C++ APIs
//  2. Just assume the user passed in enough arguments.
//  3. Iterate through each formattable returned, and assign to the arguments
U_CAPI void
u_parseMessage( const char   *locale,
                const char16_t  *pattern,
                int32_t      patternLength,
                const char16_t  *source,
                int32_t      sourceLength,
                UErrorCode   *status,
                ...)
{}

U_CAPI void U_EXPORT2
u_vparseMessage(const char  *locale,
                const char16_t *pattern,
                int32_t     patternLength,
                const char16_t *source,
                int32_t     sourceLength,
                va_list     ap,
                UErrorCode  *status)
{}

U_CAPI void
u_parseMessageWithError(const char  *locale,
                        const char16_t *pattern,
                        int32_t     patternLength,
                        const char16_t *source,
                        int32_t     sourceLength,
                        UParseError *error,
                        UErrorCode  *status,
                        ...)
{}
U_CAPI void U_EXPORT2
u_vparseMessageWithError(const char  *locale,
                         const char16_t *pattern,
                         int32_t     patternLength,
                         const char16_t *source,
                         int32_t     sourceLength,
                         va_list     ap,
                         UParseError *error,
                         UErrorCode* status)
{}
//////////////////////////////////////////////////////////////////////////////////
//
//  Message format C API
//
/////////////////////////////////////////////////////////////////////////////////


U_CAPI UMessageFormat* U_EXPORT2
umsg_open(  const char16_t  *pattern,
            int32_t         patternLength,
            const  char     *locale,
            UParseError     *parseError,
            UErrorCode      *status)
{}

U_CAPI void U_EXPORT2
umsg_close(UMessageFormat* format)
{}

U_CAPI UMessageFormat U_EXPORT2
umsg_clone(const UMessageFormat *fmt,
           UErrorCode *status)
{}

U_CAPI void  U_EXPORT2
umsg_setLocale(UMessageFormat *fmt, const char* locale)
{}

U_CAPI const char*  U_EXPORT2
umsg_getLocale(const UMessageFormat *fmt)
{}

U_CAPI void  U_EXPORT2
umsg_applyPattern(UMessageFormat *fmt,
                           const char16_t* pattern,
                           int32_t patternLength,
                           UParseError* parseError,
                           UErrorCode* status)
{}

U_CAPI int32_t  U_EXPORT2
umsg_toPattern(const UMessageFormat *fmt,
               char16_t* result,
               int32_t resultLength,
               UErrorCode* status)
{}

U_CAPI int32_t
umsg_format(    const UMessageFormat *fmt,
                char16_t       *result,
                int32_t        resultLength,
                UErrorCode     *status,
                ...)
{}

U_CAPI int32_t U_EXPORT2
umsg_vformat(   const UMessageFormat *fmt,
                char16_t       *result,
                int32_t        resultLength,
                va_list        ap,
                UErrorCode     *status)
{}

U_CAPI void
umsg_parse( const UMessageFormat *fmt,
            const char16_t *source,
            int32_t        sourceLength,
            int32_t        *count,
            UErrorCode     *status,
            ...)
{}

U_CAPI void U_EXPORT2
umsg_vparse(const UMessageFormat *fmt,
            const char16_t *source,
            int32_t        sourceLength,
            int32_t        *count,
            va_list        ap,
            UErrorCode     *status)
{}

#define SINGLE_QUOTE
#define CURLY_BRACE_LEFT
#define CURLY_BRACE_RIGHT

#define STATE_INITIAL
#define STATE_SINGLE_QUOTE
#define STATE_IN_QUOTE
#define STATE_MSG_ELEMENT

#define MAppend(c)

int32_t umsg_autoQuoteApostrophe(const char16_t* pattern,
                 int32_t patternLength,
                 char16_t* dest,
                 int32_t destCapacity,
                 UErrorCode* ec)
{}

#endif /* #if !UCONFIG_NO_FORMATTING */