diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-10-15 20:56:26 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-10-15 20:56:26 -0500 |
commit | f3ac764684c64fbdd2094853a80b23e570cd5d9c (patch) | |
tree | 3b7f64480a1247455d28e23b6bb5ff63303c9170 /source/fud_directory.cpp | |
parent | 71976e927cca43b970cb659c03fd6908c352ea3d (diff) |
Conver to using static constructors for string, sqlite, files.
Diffstat (limited to 'source/fud_directory.cpp')
-rw-r--r-- | source/fud_directory.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/fud_directory.cpp b/source/fud_directory.cpp index 1fcebe1..1697692 100644 --- a/source/fud_directory.cpp +++ b/source/fud_directory.cpp @@ -199,13 +199,16 @@ Result<std::optional<DirectoryEntry>, FudStatus> Directory::getNextEntry() return RetType::error(m_status); } - auto entryName = String{entryNameCString}; - auto retValue = DirectoryEntry::fromStat(entryName, sBuffer); + auto entryNameResult = String::makeFromCString(entryNameCString); + if (entryNameResult.isError()) { + return RetType::error(entryNameResult); + } + auto retValue = DirectoryEntry::fromStat(entryNameResult.getOkay(), sBuffer); if (retValue.isOkay()) { m_errorCode = 0; m_status = FudStatus::Success; - return RetType::okay(std::move(retValue.getOkay())); + return RetType::okay(retValue.takeOkay()); } m_status = retValue.getError(); |