mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-17 11:24:27 +01:00
More std::string_view
This commit is contained in:
1 parent
b472eb8b8b
commit
c9acf8e80e
5 files changed
+25
-21
No files matched your search
@@ -163,14 +163,14 @@ static bool ParseFileInfo(std::string_view line, File::FileInfo *fileInfo) {
|
||||
std::vector<std::string> parts;
|
||||
SplitString(line, '|', parts);
|
||||
if (parts.size() != 4) {
|
||||
ERROR_LOG(Log::FileSystem, "Bad format (1): %s", line.c_str());
|
||||
ERROR_LOG(Log::FileSystem, "Bad format (1): %.*s", (int)line.size(), line.data());
|
||||
return false;
|
||||
}
|
||||
fileInfo->name = parts[2];
|
||||
fileInfo->isDirectory = parts[0][0] == 'D';
|
||||
fileInfo->exists = true;
|
||||
if (1 != sscanf(parts[1].c_str(), "%" PRIu64, &fileInfo->size)) {
|
||||
ERROR_LOG(Log::FileSystem, "Bad format (2): %s", line.c_str());
|
||||
ERROR_LOG(Log::FileSystem, "Bad format (2): %.*s", (int)line.size(), line.data());
|
||||
return false;
|
||||
}
|
||||
fileInfo->isWritable = true; // TODO: Should be passed as part of the string.
|
||||
@@ -180,7 +180,7 @@ static bool ParseFileInfo(std::string_view line, File::FileInfo *fileInfo) {
|
||||
|
||||
uint64_t lastModifiedMs = 0;
|
||||
if (1 != sscanf(parts[3].c_str(), "%" PRIu64, &lastModifiedMs)) {
|
||||
ERROR_LOG(Log::FileSystem, "Bad format (3): %s", line.c_str());
|
||||
ERROR_LOG(Log::FileSystem, "Bad format (3): %.*s", (int)line.size(), line.data());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user