Home
last modified time | relevance | path

Searched refs:str (Results 1 – 25 of 116) sorted by relevance

12345

/drivers/peripheral/thermal/interfaces/hdi_service/src/
Dthermal_hdf_utils.cpp73 void ThermalHdfUtils::TrimStr(std::string& str) in TrimStr() argument
75 if (str.empty()) { in TrimStr()
78 str.erase(std::remove(str.begin(), str.end(), '\n'), str.end()); in TrimStr()
79 str.erase(std::remove(str.begin(), str.end(), '\r'), str.end()); in TrimStr()
/drivers/peripheral/battery/interfaces/hdi_service/include/
Dpower_supply_provider.h118 static inline int32_t ParseInt(const char* str);
119 static inline void Trim(char* str);
120 static inline void CapacityAssigner(const char* str, struct BatterydInfo* info);
121 static inline void TotalEnergyAssigner(const char* str, struct BatterydInfo* info);
122 static inline void CurrentAverageAssigner(const char* str, struct BatterydInfo* info);
123 static inline void CurrentNowAssigner(const char* str, struct BatterydInfo* info);
124 static inline void RemainEnergyAssigner(const char* str, struct BatterydInfo* info);
125 static inline void VoltageAssigner(const char* str, struct BatterydInfo* info);
126 static inline void TemperatureAssigner(const char* str, struct BatterydInfo* info);
127 static int32_t HealthStateEnumConverter(const char* str);
[all …]
/drivers/external_device_manager/services/native/driver_extension_manager/src/drivers_pkg_manager/
Ddriver_info.cpp24 int32_t DriverInfo::Serialize(string &str) in Serialize() argument
39 str = Json::writeString(builder, root); in Serialize()
40 EDM_LOGI(MODULE_COMMON, "DriverInfo Serialize Done, %{public}s", str.c_str()); in Serialize()
72 int32_t DriverInfo::UnSerialize(const string &str) in UnSerialize() argument
78 auto rawJsonLength = static_cast<int32_t>(str.length()); in UnSerialize()
80 str.c_str(), rawJsonLength); in UnSerialize()
81 bool ret = reader->parse(str.c_str(), str.c_str() + rawJsonLength, &jsonObj, &err); in UnSerialize()
84 ret, str.c_str()); in UnSerialize()
/drivers/hdf_core/adapter/uhdf2/host/test/unittest/sample_driver/
Dsample_hdi.h31 const char *str; member
76 OsalMemFree(const_cast<void *>(static_cast<const void *>(dataBlock->str))); in DataBlockFree()
105 const char *str = nullptr; in DataBlockBlockUnmarshalling() local
106 if (!HdfSbufReadBuffer(data, reinterpret_cast<const void **>(&str), &readSize)) { in DataBlockBlockUnmarshalling()
111 dataBlock->str = strdup(str); in DataBlockBlockUnmarshalling()
112 if (dataBlock->str == nullptr) { in DataBlockBlockUnmarshalling()
126 if (!HdfSbufWriteBuffer(data, dataBlock->str, strlen(dataBlock->str) + 1)) { in DataBlockBlockMarshalling()
Dsample_driver.cpp60 const char *str = HdfSbufReadString(data); in DevHostSampleDumpService() local
61 while (str != NULL && argv > 0) { in DevHostSampleDumpService()
62 HDF_LOGI("%{public}s read:%{public}s", __func__, str); in DevHostSampleDumpService()
63 str = HdfSbufReadString(data); in DevHostSampleDumpService()
/drivers/peripheral/battery/interfaces/hdi_service/src/
Dpower_supply_provider.cpp62 const char* str; member
78 inline int32_t PowerSupplyProvider::ParseInt(const char* str) in ParseInt() argument
80 return static_cast<int32_t>(strtol(str, nullptr, STR_TO_LONG_LEN)); in ParseInt()
83 inline void PowerSupplyProvider::Trim(char* str) in Trim() argument
85 if (str == nullptr) { in Trim()
89 str[strcspn(str, "\n")] = 0; in Trim()
92 inline void PowerSupplyProvider::CapacityAssigner(const char* str, struct BatterydInfo* info) in CapacityAssigner() argument
94 info->capacity_ = ParseInt(str); // default in percent format in CapacityAssigner()
97 inline void PowerSupplyProvider::TotalEnergyAssigner(const char* str, struct BatterydInfo* info) in TotalEnergyAssigner() argument
99 info->totalEnergy_ = ParseInt(str); in TotalEnergyAssigner()
[all …]
/drivers/hdf_core/framework/tools/hc-gen/src/
Ddecompile_gen.cpp35 void DecompileGen::WriteFile(const std::string &str) in WriteFile() argument
37 file_ << str; in WriteFile()
104 WriteFile(outStr.str()); in PrintBaseType()
108 WriteFile(outStr.str()); in PrintBaseType()
135 std::string str; in OutPutWalk() local
138 str = astObj->Name() + " {\n"; in OutPutWalk()
139 WriteFile(str); in OutPutWalk()
146 str = astObj->Name() + " = "; in OutPutWalk()
147 WriteFile(str); in OutPutWalk()
Dtoken.cpp35 std::string str; in TokenType2String() local
37 str.push_back(static_cast<char>(type)); in TokenType2String()
38 return str; in TokenType2String()
40 str = tokenTypeMap[type]; in TokenType2String()
43 return str; in TokenType2String()
Dtext_gen.cpp132 std::string TextGen::ToUpperCamelString(const std::string &str) in ToUpperCamelString() argument
134 if (str.empty()) { in ToUpperCamelString()
135 return str; in ToUpperCamelString()
137 auto out = ToCamelString(str); in ToUpperCamelString()
143 std::string TextGen::ToLowerCamelString(const std::string &str) in ToLowerCamelString() argument
145 if (str.empty()) { in ToLowerCamelString()
146 return str; in ToLowerCamelString()
148 auto out = ToCamelString(str); in ToLowerCamelString()
154 std::string TextGen::ToCamelString(const std::string &str) in ToCamelString() argument
156 if (str.empty()) { in ToCamelString()
[all …]
Dtext_gen.h40 static std::string ToUpperCamelString(const std::string &str);
42 static std::string ToLowerCamelString(const std::string &str);
44 static std::string ToCamelString(const std::string &str);
46 static const std::string &ToUpperString(std::string &str);
/drivers/hdf_core/framework/utils/src/
Dhdf_cstring.c26 struct HdfCString *HdfCStringObtain(const char *str) in HdfCStringObtain() argument
30 if (str != NULL) { in HdfCStringObtain()
31 size_t strLen = strlen(str); in HdfCStringObtain()
41 if (strncpy_s(instance->value, strLen + 1, str, strLen) != EOK) { in HdfCStringObtain()
/drivers/peripheral/usb/sample/host/src/
Dusb_pnp_sample.c30 char str[STR_LEN]; in UsbPnpSampleTestWriteLog() local
42 (void)snprintf_s(str, STR_LEN, STR_LEN - 1, "[XTSCHECK] %d.%06d, %s\n", in UsbPnpSampleTestWriteLog()
45 (void)fwrite(str, strlen(str), 1, fp); in UsbPnpSampleTestWriteLog()
Dusbhost_pnp_test.c42 char str[STR_LEN] = {0}; in TestPnpWriteLog() local
50 int32_t ret = snprintf_s(str, STR_LEN, STR_LEN - 1, "[XTSCHECK] %d.%06d, %s\n", in TestPnpWriteLog()
58 (void)fwrite(str, strlen(str), 1, fp); in TestPnpWriteLog()
/drivers/peripheral/audio/hal/hdi_binder/server/src/
Dhdf_audio_pnp_uevent_hdmi.c86 static int32_t AudioPnpUeventParse(const char *str) in AudioPnpUeventParse() argument
88 if (str == NULL) { in AudioPnpUeventParse()
93 while (*str != '\0') { in AudioPnpUeventParse()
94 if (strncmp(str, UEVENT_STATE, strlen(UEVENT_STATE)) == 0) { in AudioPnpUeventParse()
95 const char *temp = str + strlen(UEVENT_STATE) + 1; // 1 is a skip character '=' in AudioPnpUeventParse()
100 str += strlen(str) + 1; // 1 is a skip character '\0' in AudioPnpUeventParse()
/drivers/peripheral/usb/sample/device/linux/
Dacm_write.c70 char str[STR_LEN] = {0}; in AcmWrite() local
72 …status = snprintf_s(str, STR_LEN, STR_LEN - 1, "[XTSCHECK] %d.%06d, send data[%s] to host\n", time… in AcmWrite()
83 (void)fwrite(str, strlen(str), 1, fp); in AcmWrite()
Dacm_read.c46 char str[STR_LEN] = {0}; in TestRead() local
48 …int32_t ret = snprintf_s(str, STR_LEN, STR_LEN - 1, "[XTSCHECK] %d.%06d, recv data[%s] from host\n… in TestRead()
54 (void)fwrite(str, strlen(str), 1, fp); in TestRead()
/drivers/external_device_manager/utils/include/
Dext_object.h34 virtual int32_t Serialize(std::string &str) = 0;
35 virtual int32_t UnSerialize(const std::string &str) = 0;
40 int32_t Serialize(std::string &str) override;
41 int32_t UnSerialize(const std::string &str) override;
/drivers/peripheral/camera/vdi_base/common/pipeline_core/pipeline_impl/src/parser/
Dconfig_parser.cpp17 std::optional<int32_t> ConfigParser::GetTypeId(const std::string& str, G_STREAM_INFO info, const in… in GetTypeId() argument
19 if (str.empty() || info == nullptr) { in GetTypeId()
25 if (std::string(info[i].name) == str) { in GetTypeId()
/drivers/external_device_manager/test/fuzztest/bus_extension_fuzzer/usbextension_fuzzer/
Dusbextension_fuzzer.cpp40 string str(reinterpret_cast<const char *>(data)); in ParseDriverInfoTest()
44 vids.value = str; in ParseDriverInfoTest()
46 pids.value = str; in ParseDriverInfoTest()
/drivers/peripheral/audio/test/audio_utils/audio_mixer/
Daudio_mixer_main.c381 static int32_t ParseElemIndex(const char *str, struct AudioHwCtlElemIndex *sid) in ParseElemIndex() argument
385 while (isspace(*str) || *str == '\t') { in ParseElemIndex()
386 str++; in ParseElemIndex()
389 if (!(*str)) { in ParseElemIndex()
395 if (strncasecmp(str, "name", strlen("name")) == 0) { in ParseElemIndex()
396 ret = ParseName(str + strlen("name"), &sid->eId); in ParseElemIndex()
403 } else if (strncasecmp(str, "numid", strlen("numid")) == 0) { in ParseElemIndex()
404 ret = ParseNumId(str + strlen("numid"), &sid->index); in ParseElemIndex()
410 while (!isdigit(*str)) { in ParseElemIndex()
411 str++; in ParseElemIndex()
[all …]
/drivers/hdf_core/framework/utils/include/
Dhcs_blob_if.h74 #define HCS_STRING_LENGTH(str) (HcsIsByteAlign() ? HcsAlignSize(strlen(str) + 1) : (strlen(str) + 1… argument
/drivers/hdf_core/adapter/uhdf2/host/
Ddevhost.c59 bool HdfStringToInt(const char *str, int *value) in HdfStringToInt() argument
61 if (str == NULL || value == NULL) { in HdfStringToInt()
68 long result = strtol(str, &end, base); in HdfStringToInt()
69 if (end == str || end[0] != '\0' || errno == ERANGE || result > INT_MAX || result < INT_MIN) { in HdfStringToInt()
/drivers/peripheral/distributed_camera/hdi_service/src/utils/
Ddcamera.cpp66 void SplitString(const std::string &str, std::vector<std::string> &tokens, const std::string &delim… in SplitString() argument
69 std::string::size_type pos = str.find(delimiters); in SplitString()
71 tokens.push_back(str.substr(lastPos, pos - lastPos)); in SplitString()
73 pos = str.find(delimiters, lastPos); in SplitString()
75 if (lastPos != str.length()) { in SplitString()
76 tokens.push_back(str.substr(lastPos)); in SplitString()
/drivers/hdf_core/framework/tools/hdf_dev_eco_tool/command_line/
Dhdf_command_line_server.py82 msg_header = str(head_bytes, encoding="utf-8")
87 body = str(body_bytes, encoding='utf-8')
108 self._send_back_success(str(ret))
122 str(exc))
/drivers/hdf_core/framework/model/misc/vibrator/driver/include/
Dvibrator_driver_type.h22 #define CHECK_VIBRATOR_PARSER_RESULT_RETURN_VALUE(ret, str) do { \ argument
24 HDF_LOGE("%s:line %d %s fail, ret = %d!", __func__, __LINE__, str, ret); \

12345