intl/icu/source/i18n/measfmt.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/icu/source/i18n/measfmt.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +/*
     1.5 +**********************************************************************
     1.6 +* Copyright (c) 2004-2011, International Business Machines
     1.7 +* Corporation and others.  All Rights Reserved.
     1.8 +**********************************************************************
     1.9 +* Author: Alan Liu
    1.10 +* Created: April 20, 2004
    1.11 +* Since: ICU 3.0
    1.12 +**********************************************************************
    1.13 +*/
    1.14 +#include "unicode/utypes.h"
    1.15 +
    1.16 +#if !UCONFIG_NO_FORMATTING
    1.17 +
    1.18 +#include "unicode/measfmt.h"
    1.19 +#include "currfmt.h"
    1.20 +
    1.21 +U_NAMESPACE_BEGIN
    1.22 +
    1.23 +MeasureFormat::MeasureFormat() {}
    1.24 +
    1.25 +MeasureFormat::~MeasureFormat() {}
    1.26 +
    1.27 +MeasureFormat* U_EXPORT2 MeasureFormat::createCurrencyFormat(const Locale& locale,
    1.28 +                                                   UErrorCode& ec) {
    1.29 +    CurrencyFormat* fmt = NULL;
    1.30 +    if (U_SUCCESS(ec)) {
    1.31 +        fmt = new CurrencyFormat(locale, ec);
    1.32 +        if (U_FAILURE(ec)) {
    1.33 +            delete fmt;
    1.34 +            fmt = NULL;
    1.35 +        }
    1.36 +    }
    1.37 +    return fmt;
    1.38 +}
    1.39 +
    1.40 +MeasureFormat* U_EXPORT2 MeasureFormat::createCurrencyFormat(UErrorCode& ec) {
    1.41 +    if (U_FAILURE(ec)) {
    1.42 +        return NULL;
    1.43 +    }
    1.44 +    return MeasureFormat::createCurrencyFormat(Locale::getDefault(), ec);
    1.45 +}
    1.46 +
    1.47 +U_NAMESPACE_END
    1.48 +
    1.49 +#endif /* #if !UCONFIG_NO_FORMATTING */

mercurial