Merge pull request from icu-units/namespace

Use namespace ::icu::units::impl for units-related code.
This commit is contained in:
Hugo 2020-07-07 20:41:44 +02:00 committed by GitHub
commit 57b35a8a93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 24 additions and 2 deletions

View file

@ -15,6 +15,7 @@
#include "unitconverter.h"
U_NAMESPACE_BEGIN
namespace units {
ComplexUnitsConverter::ComplexUnitsConverter(const MeasureUnit &inputUnit,
const MeasureUnit &outputUnits,
@ -123,6 +124,7 @@ MaybeStackVector<Measure> ComplexUnitsConverter::convert(double quantity, UError
return result;
}
} // namespace units
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */

View file

@ -15,6 +15,7 @@
#include "unitsdata.h"
U_NAMESPACE_BEGIN
namespace units {
/**
* Converts from single or compound unit to single, compound or mixed units.
@ -60,6 +61,7 @@ class U_I18N_API ComplexUnitsConverter {
MaybeStackVector<MeasureUnit> units_;
};
} // namespace units
U_NAMESPACE_END
#endif //__COMPLEXUNITSCONVERTER_H__

View file

@ -9,9 +9,12 @@
#include "number_types.h"
#include "unitsrouter.h"
U_NAMESPACE_BEGIN namespace number {
U_NAMESPACE_BEGIN
namespace number {
namespace impl {
using ::icu::units::UnitsRouter;
/**
* A MicroPropsGenerator which uses UnitsRouter to produce output converted to a
* MeasureUnit appropriate for a particular localized usage: see

View file

@ -16,6 +16,7 @@
#include "unitconverter.h"
U_NAMESPACE_BEGIN
namespace units {
namespace {
@ -503,6 +504,7 @@ double UnitConverter::convert(double inputValue) const {
return result * 1.000000000001;
}
} // namespace units
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */

View file

@ -14,6 +14,7 @@
#include "unitsdata.h"
U_NAMESPACE_BEGIN
namespace units {
/**
* Represents the conversion rate between `source` and `target`.
@ -89,6 +90,7 @@ class U_I18N_API UnitConverter : public UMemory {
ConversionRate conversionRate_;
};
} // namespace units
U_NAMESPACE_END
#endif //__UNITCONVERTER_H__

View file

@ -14,6 +14,7 @@
#include "util.h"
U_NAMESPACE_BEGIN
namespace units {
namespace {
@ -414,6 +415,7 @@ void U_I18N_API UnitPreferences::getPreferencesFor(StringPiece category, StringP
preferenceCount = m->prefsCount;
}
} // namespace units
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */

View file

@ -13,6 +13,7 @@
#include "unicode/stringpiece.h"
U_NAMESPACE_BEGIN
namespace units {
/**
* Looks up the unit category of a base unit identifier.
@ -190,6 +191,7 @@ class U_I18N_API UnitPreferences {
MaybeStackVector<UnitPreference> unitPrefs_;
};
} // namespace units
U_NAMESPACE_END
#endif //__GETUNITSDATA_H__

View file

@ -18,6 +18,7 @@
#include "uresimp.h"
U_NAMESPACE_BEGIN
namespace units {
UnitsRouter::UnitsRouter(MeasureUnit inputUnit, StringPiece region, StringPiece usage,
UErrorCode &status) {
@ -68,6 +69,7 @@ const MaybeStackVector<MeasureUnit> *UnitsRouter::getOutputUnits() const {
return &outputUnits_;
}
} // namespace units
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */

View file

@ -19,6 +19,7 @@
#include "unitsdata.h"
U_NAMESPACE_BEGIN
namespace units {
/**
* Contains the complex unit converter and the limit which representing the smallest value that the
@ -93,6 +94,7 @@ class U_I18N_API UnitsRouter {
MaybeStackVector<ConverterPreference> converterPreferences_;
};
} // namespace units
U_NAMESPACE_END
#endif //__UNITSROUTER_H__

View file

@ -6,6 +6,8 @@
#include "unitsdata.h"
#include "intltest.h"
using namespace ::icu::units;
class UnitsDataTest : public IntlTest {
public:
UnitsDataTest() {}

View file

@ -30,7 +30,8 @@ struct UnitConversionTestCase {
const double expectedValue;
};
using icu::number::impl::DecimalQuantity;
using ::icu::number::impl::DecimalQuantity;
using namespace ::icu::units;
class UnitsTest : public IntlTest {
public: