forked from eden-emu/eden
[common, fs] Use std::string_view instead of std::string&; inline functions that are used rarely (#330)
Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: eden-emu/eden#330 Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
dae0d7bec6
commit
09e77fa146
8 changed files with 76 additions and 89 deletions
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
@ -56,8 +59,8 @@ NAX::NAX(VirtualFile file_)
|
|||
return;
|
||||
}
|
||||
|
||||
const std::string two_dir = Common::ToUpper(match[1]);
|
||||
const std::string nca_id = Common::ToLower(match[2]);
|
||||
const std::string two_dir = Common::ToUpper(std::string{match[1]});
|
||||
const std::string nca_id = Common::ToLower(std::string{match[2]});
|
||||
status = Parse(fmt::format("/registered/{}/{}.nca", two_dir, nca_id));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
@ -61,25 +64,23 @@ FileType IdentifyFile(FileSys::VirtualFile file) {
|
|||
FileType GuessFromFilename(const std::string& name) {
|
||||
if (name == "main")
|
||||
return FileType::DeconstructedRomDirectory;
|
||||
if (name == "00")
|
||||
else if (name == "00")
|
||||
return FileType::NCA;
|
||||
|
||||
const std::string extension =
|
||||
auto const extension =
|
||||
Common::ToLower(std::string(Common::FS::GetExtensionFromFilename(name)));
|
||||
|
||||
if (extension == "nro")
|
||||
return FileType::NRO;
|
||||
if (extension == "nso")
|
||||
else if (extension == "nso")
|
||||
return FileType::NSO;
|
||||
if (extension == "nca")
|
||||
else if (extension == "nca")
|
||||
return FileType::NCA;
|
||||
if (extension == "xci")
|
||||
else if (extension == "xci")
|
||||
return FileType::XCI;
|
||||
if (extension == "nsp")
|
||||
else if (extension == "nsp")
|
||||
return FileType::NSP;
|
||||
if (extension == "kip")
|
||||
else if (extension == "kip")
|
||||
return FileType::KIP;
|
||||
|
||||
return FileType::Unknown;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue