loader namespace

This commit is contained in:
georgemoralis 2024-02-29 17:20:52 +02:00
parent 30f3f8cb20
commit f933ba262e
3 changed files with 8 additions and 1 deletions

View file

@ -5,6 +5,8 @@
#include "common/types.h"
#include "loader.h"
namespace Loader {
FileTypes DetectFileType(const std::string& filepath) {
// No file loaded
if (filepath.empty()) {
@ -22,3 +24,5 @@ FileTypes DetectFileType(const std::string& filepath) {
}
return FileTypes::Unknown;
}
} // namespace Loader

View file

@ -5,9 +5,12 @@
#include <string>
namespace Loader {
enum class FileTypes {
Unknown,
Pkg,
};
FileTypes DetectFileType(const std::string& filepath);
} // namespace Loader

View file

@ -280,7 +280,7 @@ void MainWindow::InstallPkg() {
void MainWindow::InstallDragDropPkg(std::string file, int pkgNum, int nPkg) {
if (DetectFileType(file) == FileTypes::Pkg) {
if (Loader::DetectFileType(file) == Loader::FileTypes::Pkg) {
PKG pkg;
pkg.Open(file);
std::string failreason;