1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except", "in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef OHOS_GLOBAL_I18N_MEASURE_DATA_H 16 #define OHOS_GLOBAL_I18N_MEASURE_DATA_H 17 18 #include <vector> 19 #include <string> 20 #include "unicode/measunit.h" 21 22 namespace OHOS { 23 namespace Global { 24 namespace I18n { 25 uint32_t GetMask(const std::string ®ion); 26 void GetDefaultPreferredUnit(const std::string ®ion, const std::string &type, std::vector<std::string> &units); 27 void GetFallbackPreferredUnit(const std::string ®ion, const std::string &usage, std::vector<std::string> &units); 28 void GetRestPreferredUnit(const std::string ®ion, const std::string &usage, std::vector<std::string> &units); 29 void GetPreferredUnit(const std::string ®ion, const std::string &usage, std::vector<std::string> &units); 30 void ComputeFactorValue(const std::string &unit, const std::string &measSys, std::vector<double> &factors); 31 double ComputeSIPrefixValue(const std::string &unit); 32 void ComputePowerValue(const std::string &unit, const std::string &measSys, std::vector<double> &factors); 33 int ComputeValue(const std::string &unit, const std::string &measSys, std::vector<double> &factors); 34 int Convert(double &value, const std::string &fromUnit, const std::string &fromMeasSys, const std::string &toUnit, 35 const std::string &toMeasSys); 36 } // namespace I18n 37 } // namespace Global 38 } // namespace OHOS 39 #endif