Lines Matching refs:filePath

31 /* static */ int FileUtils::getFileSize(const char *const filePath) {
32 const int fd = open(filePath, O_RDONLY);
75 char filePath[filePathBufSize];
76 getFilePath(dirPath, dirent->d_name, filePathBufSize, filePath);
77 if (remove(filePath) != 0) {
78 AKLOGE("Cannot remove file %s.", filePath);
97 /* static */ int FileUtils::getFilePathWithSuffixBufSize(const char *const filePath,
99 return strlen(filePath) + strlen(suffix) + 1 /* terminator */;
102 /* static */ void FileUtils::getFilePathWithSuffix(const char *const filePath,
104 snprintf(outFilePath, filePathBufSize, "%s%s", filePath, suffix);
117 /* static */ bool FileUtils::getFilePathWithoutSuffix(const char *const filePath,
119 const int filePathLength = strlen(filePath);
123 filePath, filePathLength, suffix, suffixLength);
128 AKLOGE("outDirPathBufSize is too small. filePath: %s, suffix: %s, outDirPathBufSize: %d",
129 filePath, suffix, outDirPathBufSize);
132 if (strncmp(filePath + resultFilePathLength, suffix, suffixLength) != 0) {
133 AKLOGE("File Path %s does not have %s as a suffix", filePath, suffix);
136 snprintf(outDirPath, resultFilePathLength + 1 /* terminator */, "%s", filePath);
140 /* static */ void FileUtils::getDirPath(const char *const filePath, const int outDirPathBufSize,
142 for (int i = strlen(filePath) - 1; i >= 0; --i) {
143 if (filePath[i] == '/') {
145 AKLOGE("outDirPathBufSize is too small. filePath: %s, outDirPathBufSize: %d",
146 filePath, outDirPathBufSize);
150 snprintf(outDirPath, i + 1 /* terminator */, "%s", filePath);
156 /* static */ void FileUtils::getBasename(const char *const filePath,
158 const int filePathBufSize = strlen(filePath) + 1 /* terminator */;
160 snprintf(filePathBuf, filePathBufSize, "%s", filePath);
164 AKLOGE("outNameBufSize is too small. filePath: %s, outNameBufSize: %d",
165 filePath, outNameBufSize);