]> granicus.if.org Git - icu/commitdiff
add units router
authorYounies Mahmoud <younies.mahmoud@gmail.com>
Fri, 13 Mar 2020 16:26:20 +0000 (17:26 +0100)
committerYounies Mahmoud <younies.mahmoud@gmail.com>
Fri, 13 Mar 2020 16:47:26 +0000 (17:47 +0100)
icu4c/source/i18n/unitsrouter.cpp [new file with mode: 0644]
icu4c/source/i18n/unitsrouter.h [new file with mode: 0644]

diff --git a/icu4c/source/i18n/unitsrouter.cpp b/icu4c/source/i18n/unitsrouter.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/icu4c/source/i18n/unitsrouter.h b/icu4c/source/i18n/unitsrouter.h
new file mode 100644 (file)
index 0000000..6d7abf5
--- /dev/null
@@ -0,0 +1,33 @@
+// © 2020 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+
+#include "unicode/utypes.h"
+
+#if !UCONFIG_NO_FORMATTING
+#ifndef __UNITSROUTER_H__
+#define __UNITSROUTER_H__
+
+#include "unicode/errorcode.h"
+#include "unicode/measunit.h"
+#include "unicode/measure.h"
+#include "unicode/stringpiece.h"
+
+U_NAMESPACE_BEGIN
+
+class UnitConverter;
+
+class U_I18N_API UnitsRouter {
+  public:
+    UnitsRouter(MeasureUnit inputUnit, Locale locale, StringPiece usage);
+
+    LocalArray<Measure> route(double quantity, UErrorCode &status);
+
+  private:
+    LocalArray<UnitConverter> unitsConverters;
+};
+
+U_NAMESPACE_END
+
+#endif //__UNITSROUTER_H__
+
+#endif /* #if !UCONFIG_NO_FORMATTING */