Home
last modified time | relevance | path

Searched refs:unit (Results 1 – 25 of 32) sorted by relevance

12

/base/global/i18n/frameworks/intl/src/
Drelative_time_format.cpp122 std::string RelativeTimeFormat::Format(double number, const std::string &unit) in Format() argument
124 if (!createSuccess || !relativeUnits.count(unit)) { in Format()
131 …formattedTime = relativeTimeFormat->formatNumericToValue(number, relativeUnits[unit], status).toSt… in Format()
133 …formattedTime = relativeTimeFormat->formatToValue(number, relativeUnits[unit], status).toString(st… in Format()
140 const std::string &unit, bool isInteger, const std::string &value) in InsertInfo() argument
146 info.push_back(unit); in InsertInfo()
155 std::vector<std::vector<std::string>> &timeVector, size_t &startIndex, const std::string &unit, in ProcessIntegerField() argument
160 InsertInfo(timeVector, unit, true, result.substr(startIndex, iter->first - startIndex)); in ProcessIntegerField()
161 … InsertInfo(timeVector, unit, true, result.substr(iter->first, iter->second - iter->first)); in ProcessIntegerField()
167 void RelativeTimeFormat::FormatToParts(double number, const std::string &unit, in FormatToParts() argument
[all …]
Dmeasure_data.cpp492 void ComputeFactorValue(const string &unit, const string &measSys, vector<double> &factors) in ComputeFactorValue() argument
494 string unitKey = unit + "-" + measSys; in ComputeFactorValue()
500 if (CONVERT_FACTORS.count(unit) > 0) { in ComputeFactorValue()
501 factors[0] = CONVERT_FACTORS.at(unit)[0]; in ComputeFactorValue()
502 factors[1] = CONVERT_FACTORS.at(unit)[1]; in ComputeFactorValue()
506 double ComputeSIPrefixValue(const string &unit) in ComputeSIPrefixValue() argument
509 if (!unit.rfind(prefixValue.first, 0)) { in ComputeSIPrefixValue()
516 void ComputePowerValue(const string &unit, const string &measSys, vector<double> &factors) in ComputePowerValue() argument
519 if (!unit.rfind(powerValue.first, 0)) { in ComputePowerValue()
520 string baseUnit = unit.substr(powerValue.first.length()); in ComputePowerValue()
[all …]
Dnumber_format.cpp149 … numberFormat.unit(icu::CurrencyUnit(icu::UnicodeString(currency.c_str()).getBuffer(), status)); in InitProperties()
156 …numberFormat = numberFormat.unit(icu::NoUnit::percent()).scale(icu::number::Scale::powerOfTen(2)).… in InitProperties()
161 if (!strcmp(curUnit.getSubtype(), unit.c_str())) { in InitProperties()
162 numberFormat = numberFormat.unit(curUnit); in InitProperties()
237 unit = configs["unit"]; in ParseConfigs()
317 numberFormat = numberFormat.unit(curUnit); in SetUnit()
328 std::string finalUnit = unit; in Format()
346 int status = Convert(num, unit, unitMeasSys, preferredUnits[i], unitMeasSys); in Format()
399 if (!unit.empty()) { in GetResolvedOptions()
400 map.insert(std::make_pair("unit", unit)); in GetResolvedOptions()
/base/global/i18n/frameworks/intl/include/
Dmeasure_data.h30 void ComputeFactorValue(const std::string &unit, const std::string &measSys, std::vector<double> &f…
31 double ComputeSIPrefixValue(const std::string &unit);
32 void ComputePowerValue(const std::string &unit, const std::string &measSys, std::vector<double> &fa…
33 int ComputeValue(const std::string &unit, const std::string &measSys, std::vector<double> &factors);
34 bool ConvertByte(double& number, std::string& unit);
35 bool ConvertDate(double& number, std::string& unit);
Drelative_time_format.h52 std::string Format(double number, const std::string &unit);
53 …void FormatToParts(double number, const std::string &unit, std::vector<std::vector<std::string>> &…
71 …void InsertInfo(std::vector<std::vector<std::string>> &timeVector, const std::string &unit, bool i…
74 … std::vector<std::vector<std::string>> &timeVector, size_t &startIndex, const std::string &unit,
Dnumber_format.h68 std::string unit; variable
/base/global/i18n_lite/frameworks/i18n/src/
Dmeasure_format.cpp55 std::string MeasureFormat::Format(double num, std::string unit, I18nStatus &status, MeasureFormatTy… in Format() argument
61 return measureFormatImpl->Format(num, unit, type, status); in Format()
64 std::string MeasureFormat::Format(int num, std::string unit, I18nStatus &status, MeasureFormatType … in Format() argument
70 return measureFormatImpl->Format(num, unit, type, status); in Format()
Dmeasure_format_impl.cpp55 std::string MeasureFormatImpl::Format(double num, std::string &unit, MeasureFormatType type, I18nSt… in Format() argument
58 return FormatInner(false, unit, type, status); in Format()
61 std::string MeasureFormatImpl::Format(int num, std::string &unit, MeasureFormatType type, I18nStatu… in Format() argument
64 return FormatInner(true, unit, type, status); in Format()
67 std::string MeasureFormatImpl::FormatInner(bool isInteger, std::string &unit, MeasureFormatType typ… in FormatInner() argument
70 int unitIndex = SearchUnits(unit, status); in FormatInner()
/base/global/i18n/frameworks/intl/test/unittest/
Dintl_test.cpp1000 string unit = "year"; variable
1001 string res = formatter->Format(number, unit);
1004 formatter->FormatToParts(number, unit, timeVector);
1008 unit = "quarter";
1009 res = formatter->Format(number, unit);
1011 formatter->FormatToParts(number, unit, timeVector);
1015 unit = "month";
1016 res = formatter->Format(number, unit);
1018 formatter->FormatToParts(number, unit, timeVector);
1022 unit = "week";
[all …]
Di18n_test.cpp483 std::string unit = "tablespoon"; variable
486 ComputeFactorValue(unit, measSys, factors);
489 unit = "acre";
491 ComputeFactorValue(unit, measSys, factors);
495 double res = ComputeSIPrefixValue(unit);
497 unit = "deci";
498 res = ComputeSIPrefixValue(unit);
501 unit = "square-acre";
503 ComputePowerValue(unit, measSys, factors);
506 unit = "fake-per-hour";
[all …]
/base/global/i18n_lite/frameworks/i18n/test/unittest/lite/common/
Di18n_test.cpp1232 std::string unit = "min"; variable
1235 std::string out = formatter.Format(12, unit, status);
1237 out = formatter.Format(12, unit, status, MeasureFormatType::MEASURE_SHORT);
1239 out = formatter.Format(12, unit, status, MeasureFormatType::MEASURE_MEDIUM);
1243 out = formatter.Format(12, unit, status, MeasureFormatType::MEASURE_LONG);
1245 out = formatter.Format(12, unit, status, MeasureFormatType::MEASURE_FULL);
1249 out = formatter.Format(1, unit, status);
1251 out = formatter.Format(1, unit, status, MeasureFormatType::MEASURE_SHORT);
1253 out = formatter.Format(1, unit, status, MeasureFormatType::MEASURE_MEDIUM);
1257 out = formatter.Format(1, unit, status, MeasureFormatType::MEASURE_LONG);
[all …]
/base/hiviewdfx/hilog/frameworks/libhilog/utils/
Dlog_utils.cpp59 uint64_t unit = 1; in Size2Str() local
61 case 0 ... ONE_KB - 1: unit = 1; break; in Size2Str()
62 case ONE_KB ... ONE_MB - 1: unit = ONE_KB; break; in Size2Str()
63 case ONE_MB ... ONE_GB - 1: unit = ONE_MB; break; in Size2Str()
64 case ONE_GB ... ONE_TB - 1: unit = ONE_GB; break; in Size2Str()
65 default: unit = ONE_TB; break; in Size2Str()
67 float i = (static_cast<float>(size)) / unit; in Size2Str()
76 return str + g_SizeMap.GetKey(unit); in Size2Str()
86 uint64_t unit = g_SizeMap.GetValue(str[index]); in Str2Size() local
88 uint64_t value = stoull(str.substr(0, unit !=0 ? index : index + 1)); in Str2Size()
[all …]
/base/global/i18n_lite/frameworks/i18n/include/
Dmeasure_format_impl.h33 std::string Format(double num, std::string &unit, MeasureFormatType type, I18nStatus &status);
34 std::string Format(int num, std::string &unit, MeasureFormatType type, I18nStatus &status);
37 …std::string FormatInner(bool isInteger, std::string &unit, MeasureFormatType type, I18nStatus &sta…
/base/global/i18n_lite/interfaces/kits/i18n/include/
Dmeasure_format.h93 std::string Format(int num, std::string unit, I18nStatus &status,
110 std::string Format(double num, std::string unit, I18nStatus &status,
/base/global/resource_management/frameworks/resmgr/src/
Dresource_manager_impl.cpp551 std::string unit; in GetThemeFloat() local
552 RState state = ParseFloat(result.c_str(), outValue, unit); in GetThemeFloat()
553 return state == SUCCESS ? RecalculateFloat(unit, outValue) : state; in GetThemeFloat()
556 …anagerImpl::GetThemeFloat(const std::shared_ptr<IdItem> idItem, float &outValue, std::string &unit) in GetThemeFloat() argument
567 RState state = ParseFloat(result.c_str(), outValue, unit); in GetThemeFloat()
568 return state == SUCCESS ? RecalculateFloat(unit, outValue) : state; in GetThemeFloat()
584 std::string unit; in GetFloatById() local
585 RState state = GetFloat(idItem, outValue, unit); in GetFloatById()
587 return RecalculateFloat(unit, outValue); in GetFloatById()
595 RState ResourceManagerImpl::GetFloatById(uint32_t id, float &outValue, std::string &unit) in GetFloatById() argument
[all …]
/base/update/packaging_tools/
Dbuild_module_img.py60 def roundup(size, unit): argument
61 return (size + unit - 1) & (~(unit - 1))
/base/global/resource_management/frameworks/resmgr/include/
Dresource_manager_impl.h273 virtual RState GetFloatById(uint32_t id, float &outValue, std::string &unit);
290 virtual RState GetFloatByName(const char *name, float &outValue, std::string &unit);
684 RState ParseFloat(const std::string &strValue, float &result, std::string &unit);
686 RState RecalculateFloat(const std::string &unit, float &result);
688 RState GetFloat(const std::shared_ptr<IdItem> idItem, float &outValue, std::string &unit);
710 RState GetThemeFloat(const std::shared_ptr<IdItem> idItem, float &outValue, std::string &unit);
/base/global/resource_management/frameworks/resmgr/test/unittest/common/
Dresource_manager_test_common.cpp444 std::string unit; in TestGetFloatById() local
445 state = rm->GetFloatById(id, outValue, unit); in TestGetFloatById()
448 EXPECT_EQ("vp", unit); in TestGetFloatById()
464 std::string unit; in TestGetFloatByName() local
465 state = rm->GetFloatByName(touchTarget, outValue, unit); in TestGetFloatByName()
468 EXPECT_EQ("vp", unit); in TestGetFloatByName()
/base/useriam/face_auth/ui/Settings_FaceAuth/entry/src/ohosTest/ets/test/
DAbility.test.ets27 // Presets an action, which is performed before each unit test case starts.
32 // Presets a clear action, which is performed after each unit test case ends.
/base/telephony/sms_mms/
DREADME_zh.md15 短彩信模块为移动数据用户提供短信收发和彩信编解码功能,主要功能有GSM/CDMA短信收发、短信PDU(Protocol data unit,协议数据单元)编解码、Wap Push接收处理 、小区广播…
112 | pdu | Array\<number> | PDU(Protocol data unit,协议数据单元)数组 |
118 | pdu | Array\<number> | PDU(Protocol data unit,协议数据单元)数组 |
/base/theme/screenlock_mgr/
DREADME.md21 ├── test # unit test of interface
/base/global/resource_management/interfaces/inner_api/include/
Dresource_manager.h122 virtual RState GetFloatById(uint32_t id, float &outValue, std::string &unit) = 0;
126 virtual RState GetFloatByName(const char *name, float &outValue, std::string &unit) = 0;
/base/startup/init/
DREADME_zh.md83 …://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/subsystems/subsys-boot-init-sub-unit.md)
/base/global/i18n/interfaces/js/kits/src/
Dintl_addon.cpp1413 std::vector<char> unit; in FormatRelativeTime() local
1414 if (!GetStringParameter(env, argv[1], unit)) { in FormatRelativeTime()
1423 std::string value = obj->relativetimefmt_->Format(number, unit.data()); in FormatRelativeTime()
1449 napi_value unit = nullptr; in FillInArrayElement() local
1452 … status = napi_create_string_utf8(env, timeVector[i][unitIndex].c_str(), NAPI_AUTO_LENGTH, &unit); in FillInArrayElement()
1458 napi_get_undefined(env, &unit); in FillInArrayElement()
1468 napi_set_named_property(env, formatInfo, "unit", unit); in FillInArrayElement()
1486 std::vector<char> unit; in FormatToParts() local
1487 if (!GetStringParameter(env, argv[1], unit)) { in FormatToParts()
1497 obj->relativetimefmt_->FormatToParts(number, unit.data(), timeVector); in FormatToParts()
/base/time/time_service/
DREADME.md21 ├── test # unit test of interface

12