Lines Matching full:path
27 bool FileOperator::Create(const std::string &path, mode_t mode) in Create() argument
29 auto ret = mkdir(path.c_str(), mode); in Create()
31 IMSA_HILOGE("%{public}s mkdir failed, errno:%{public}d!", path.c_str(), errno); in Create()
37 bool FileOperator::IsExist(const std::string &path) in IsExist() argument
39 return access(path.c_str(), F_OK) == SUCCESS; in IsExist()
42 bool FileOperator::Read(const std::string &path, std::string &content) in Read() argument
44 std::ifstream file(path); in Read()
46 IMSA_HILOGE("%{public}s open fail!", path.c_str()); in Read()
67 IMSA_HILOGE("FilePath is not an absolute path"); in IsValidPath()
73 bool FileOperator::CheckImeCfgFilePath(const std::string &path) in CheckImeCfgFilePath() argument
75 if (path.empty()) { in CheckImeCfgFilePath()
76 IMSA_HILOGE("Path is empty"); in CheckImeCfgFilePath()
79 if (!IsValidPath(path)) { in CheckImeCfgFilePath()
80 IMSA_HILOGE("Path is IsValidPath"); in CheckImeCfgFilePath()
86 bool FileOperator::Write(const std::string &path, const std::string &content, uint32_t flags, mode_… in Write() argument
100 if (!CheckImeCfgFilePath(path)) { in Write()
101 IMSA_HILOGE("path check fail"); in Write()
105 FILE* file = fopen(path.c_str(), fopenMode); in Write()
107 IMSA_HILOGE("%{public}s open fail, errno: %{public}d", path.c_str(), errno); in Write()
112 …IMSA_HILOGE("%{public}s write fail, ret: %{public}zd, errno: %{public}d", path.c_str(), ret, errno… in Write()
114 IMSA_HILOGE("%{public}s close fail, errno: %{public}d", path.c_str(), errno); in Write()
119 IMSA_HILOGE("%{public}s close fail, errno: %{public}d", path.c_str(), errno); in Write()
125 bool FileOperator::Read(const std::string &path, const std::string &key, std::string &content) in Read() argument
131 CfgFiles *cfgFiles = GetCfgFiles(path.c_str()); in Read()
133 IMSA_HILOGE("%{public}s cfgFiles is nullptr!", path.c_str()); in Read()
151 std::string FileOperator::Read(const std::string &path, const std::string &key) in Read() argument
154 bool ret = Read(path, content); in Read()
156 IMSA_HILOGE("%{public}s read failed!", path.c_str()); in Read()
160 IMSA_HILOGD("%{public}s not contain %{public}s!", path.c_str(), key.c_str()); in Read()
166 std::string FileOperator::GetRealPath(const char *path) in GetRealPath() argument
168 if (path == nullptr) { in GetRealPath()
171 auto size = strnlen(path, PATH_MAX); in GetRealPath()
176 if (realpath(path, realPath) == nullptr) { in GetRealPath()