Lines Matching defs:path
89 std::string& path, size_t size, const char* format, const char* basePath, const char* name) const
92 if (strcpy_s(buff, PATH_MAX, path.c_str()) != EOK) {
93 BATTERY_HILOGW(FEATURE_CHARGING, "failed to copy path of %{public}s", name);
98 BATTERY_HILOGW(FEATURE_CHARGING, "failed to format path of %{public}s", name);
101 path.assign(buff, strlen(buff));
115 int32_t PowerSupplyProvider::ReadSysfsFile(const char* path, char* buf, size_t size) const
117 int32_t fd = open(path, O_RDONLY, S_IRUSR | S_IRGRP | S_IROTH);
119 BATTERY_HILOGE(FEATURE_CHARGING, "failed to open path");
131 int32_t PowerSupplyProvider::ReadBatterySysfsToBuff(const char* path, char* buf, size_t size) const
133 int32_t ret = ReadSysfsFile(path, buf, size);
135 BATTERY_HILOGW(FEATURE_CHARGING, "read path failed, ret: %{public}d", ret);
142 void PowerSupplyProvider::CreateFile(const std::string& path, const std::string& content)
144 if (access(path.c_str(), F_OK) == 0) {
148 std::ofstream stream(path.c_str());
162 BATTERY_HILOGI(FEATURE_CHARGING, "system battery path is exist");
167 BATTERY_HILOGI(FEATURE_CHARGING, "system Battery path is exist");
244 void PowerSupplyProvider::CheckSubfolderNode(const std::string& path)
247 std::string batteryPath = path_ + "/" + path;
270 (strcasecmp(path.c_str(), BATTERY_NODE_PATH.c_str()) != 0)) {
271 nodeNamePathMap_["type"] = path;
276 nodeNamePathMap_[iter.first] = path;
327 BATTERY_HILOGI(FEATURE_CHARGING, "create mockFilePath path");
335 BATTERY_HILOGI(FEATURE_CHARGING, "create mockFilePath path");
346 BATTERY_HILOGI(FEATURE_CHARGING, "create mockFilePath path");