Home | History | Annotate | Download | only in i18n
      1 /*
      2 **********************************************************************
      3 * Copyright (c) 2004-2011, International Business Machines
      4 * Corporation and others.  All Rights Reserved.
      5 **********************************************************************
      6 * Author: Alan Liu
      7 * Created: April 20, 2004
      8 * Since: ICU 3.0
      9 **********************************************************************
     10 */
     11 #include "unicode/utypes.h"
     12 
     13 #if !UCONFIG_NO_FORMATTING
     14 
     15 #include "unicode/measfmt.h"
     16 #include "currfmt.h"
     17 
     18 U_NAMESPACE_BEGIN
     19 
     20 MeasureFormat::MeasureFormat() {}
     21 
     22 MeasureFormat::~MeasureFormat() {}
     23 
     24 MeasureFormat* U_EXPORT2 MeasureFormat::createCurrencyFormat(const Locale& locale,
     25                                                    UErrorCode& ec) {
     26     CurrencyFormat* fmt = NULL;
     27     if (U_SUCCESS(ec)) {
     28         fmt = new CurrencyFormat(locale, ec);
     29         if (U_FAILURE(ec)) {
     30             delete fmt;
     31             fmt = NULL;
     32         }
     33     }
     34     return fmt;
     35 }
     36 
     37 MeasureFormat* U_EXPORT2 MeasureFormat::createCurrencyFormat(UErrorCode& ec) {
     38     if (U_FAILURE(ec)) {
     39         return NULL;
     40     }
     41     return MeasureFormat::createCurrencyFormat(Locale::getDefault(), ec);
     42 }
     43 
     44 U_NAMESPACE_END
     45 
     46 #endif /* #if !UCONFIG_NO_FORMATTING */
     47