Lines Matching full:path
39 static bool IsFileExist(const std::string &path)
42 return (stat(path.c_str(), &buffer) == 0);
71 std::string PreferencesHelper::GetRealPath(const std::string &path, int &errorCode)
73 if (path.empty()) {
74 LOG_ERROR("The path can not be empty.");
78 if (path.length() > PATH_MAX) {
79 LOG_ERROR("The path exceeds max length.");
83 std::string::size_type pos = path.find_last_of('/');
85 LOG_ERROR("path can not be relative path.");
90 if (path.at(1) != ':') {
91 LOG_ERROR("The path can not be relative path.");
95 std::string filePath = path.substr(0, pos);
97 LOG_ERROR("Failed to create path");
102 if (path.front() != '/') {
103 LOG_ERROR("The path can not be relative path.");
108 std::string fileName = path.substr(pos + 1, path.length());
115 return path;
162 LOG_ERROR("The path is invalid, prefName is %{public}s.", ExtractFileName(realPath).c_str());
189 int PreferencesHelper::DeletePreferences(const std::string &path)
192 std::string realPath = GetRealPath(path, errCode);
204 LOG_INFO("Begin to Delete Preferences: %{public}s", ExtractFileName(path).c_str());
229 if (RemoveEnhanceDbFileIfNeed(path) != E_OK) {
243 int PreferencesHelper::RemovePreferencesFromCache(const std::string &path)
246 std::string realPath = GetRealPath(path, errCode);