Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | ******************************************************************************* |
michael@0 | 3 | * Copyright (C) 2008, Google, International Business Machines Corporation and * |
michael@0 | 4 | * others. All Rights Reserved. * |
michael@0 | 5 | ******************************************************************************* |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | #include "unicode/tmutamt.h" |
michael@0 | 9 | |
michael@0 | 10 | #if !UCONFIG_NO_FORMATTING |
michael@0 | 11 | |
michael@0 | 12 | U_NAMESPACE_BEGIN |
michael@0 | 13 | |
michael@0 | 14 | UOBJECT_DEFINE_RTTI_IMPLEMENTATION(TimeUnitAmount) |
michael@0 | 15 | |
michael@0 | 16 | |
michael@0 | 17 | TimeUnitAmount::TimeUnitAmount(const Formattable& number, |
michael@0 | 18 | TimeUnit::UTimeUnitFields timeUnitField, |
michael@0 | 19 | UErrorCode& status) |
michael@0 | 20 | : Measure(number, TimeUnit::createInstance(timeUnitField, status), status) { |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | |
michael@0 | 24 | TimeUnitAmount::TimeUnitAmount(double amount, |
michael@0 | 25 | TimeUnit::UTimeUnitFields timeUnitField, |
michael@0 | 26 | UErrorCode& status) |
michael@0 | 27 | : Measure(Formattable(amount), |
michael@0 | 28 | TimeUnit::createInstance(timeUnitField, status), |
michael@0 | 29 | status) { |
michael@0 | 30 | } |
michael@0 | 31 | |
michael@0 | 32 | |
michael@0 | 33 | TimeUnitAmount::TimeUnitAmount(const TimeUnitAmount& other) |
michael@0 | 34 | : Measure(other) |
michael@0 | 35 | { |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | |
michael@0 | 39 | TimeUnitAmount& |
michael@0 | 40 | TimeUnitAmount::operator=(const TimeUnitAmount& other) { |
michael@0 | 41 | Measure::operator=(other); |
michael@0 | 42 | return *this; |
michael@0 | 43 | } |
michael@0 | 44 | |
michael@0 | 45 | |
michael@0 | 46 | UBool |
michael@0 | 47 | TimeUnitAmount::operator==(const UObject& other) const { |
michael@0 | 48 | return Measure::operator==(other); |
michael@0 | 49 | } |
michael@0 | 50 | |
michael@0 | 51 | UObject* |
michael@0 | 52 | TimeUnitAmount::clone() const { |
michael@0 | 53 | return new TimeUnitAmount(*this); |
michael@0 | 54 | } |
michael@0 | 55 | |
michael@0 | 56 | |
michael@0 | 57 | TimeUnitAmount::~TimeUnitAmount() { |
michael@0 | 58 | } |
michael@0 | 59 | |
michael@0 | 60 | |
michael@0 | 61 | |
michael@0 | 62 | const TimeUnit& |
michael@0 | 63 | TimeUnitAmount::getTimeUnit() const { |
michael@0 | 64 | return (const TimeUnit&) getUnit(); |
michael@0 | 65 | } |
michael@0 | 66 | |
michael@0 | 67 | |
michael@0 | 68 | TimeUnit::UTimeUnitFields |
michael@0 | 69 | TimeUnitAmount::getTimeUnitField() const { |
michael@0 | 70 | return getTimeUnit().getTimeUnitField(); |
michael@0 | 71 | } |
michael@0 | 72 | |
michael@0 | 73 | |
michael@0 | 74 | U_NAMESPACE_END |
michael@0 | 75 | |
michael@0 | 76 | #endif |