From f3ac764684c64fbdd2094853a80b23e570cd5d9c Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Tue, 15 Oct 2024 20:56:26 -0500 Subject: Conver to using static constructors for string, sqlite, files. --- source/fud_directory.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/fud_directory.cpp') 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, 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(); -- cgit v1.2.3