Home | History | Annotate | Download | only in utils

Lines Matching refs:dirPath

45 /* static */ bool FileUtils::existsDir(const char *const dirPath) {
46 DIR *const dir = opendir(dirPath);
55 /* static */ bool FileUtils::removeDirAndFiles(const char *const dirPath) {
56 return removeDirAndFiles(dirPath, 5 /* maxTries */);
60 /* static */ bool FileUtils::removeDirAndFiles(const char *const dirPath, const int maxTries) {
61 DIR *const dir = opendir(dirPath);
63 AKLOGE("Cannot open dir %s.", dirPath);
74 const int filePathBufSize = getFilePathBufSize(dirPath, dirent->d_name);
76 getFilePath(dirPath, dirent->d_name, filePathBufSize, filePath);
84 if (remove(dirPath) != 0) {
88 removeDirAndFiles(dirPath, maxTries - 1);
90 AKLOGE("Cannot remove directory %s.", dirPath);
107 /* static */ int FileUtils::getFilePathBufSize(const char *const dirPath,
109 return strlen(dirPath) + 1 /* '/' */ + strlen(fileName) + 1 /* terminator */;
112 /* static */ void FileUtils::getFilePath(const char *const dirPath, const char *const fileName,
114 snprintf(outFilePath, filePathBufSize, "%s/%s", dirPath, fileName);