mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-13 04:36:57 +00:00
Import Strong Logger & Config System
This commit is contained in:
parent
92d4e7a8d3
commit
014b236228
48 changed files with 3281 additions and 734 deletions
52
core/Base/PathUtil.h
Normal file
52
core/Base/PathUtil.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
// Copyright 2025 Xenon Emulator Project. All rights reserved.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <vector>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
namespace Base {
|
||||
namespace FS {
|
||||
|
||||
enum class PathType {
|
||||
BinaryDir, // Binary Path
|
||||
RootDir, // Execution Path
|
||||
LogDir, // Where log files are stored
|
||||
};
|
||||
|
||||
enum FileType {
|
||||
Directory,
|
||||
File
|
||||
};
|
||||
|
||||
// Represents a given file inside a directory.
|
||||
typedef struct _FileInfo {
|
||||
fs::path fileName; // The file name and extension
|
||||
fs::path filePath; // The file path
|
||||
size_t fileSize; // File size
|
||||
FileType fileType; // File Type (directory/file)
|
||||
} FileInfo;
|
||||
|
||||
constexpr auto LOG_DIR = "log";
|
||||
|
||||
constexpr auto LOG_FILE = "pound_log.txt";
|
||||
|
||||
// Converts a given fs::path to a UTF8 string.
|
||||
[[nodiscard]] std::string PathToUTF8String(const fs::path &path);
|
||||
|
||||
// Returns a fs::path object containing the current 'User' path.
|
||||
[[nodiscard]] const fs::path &GetUserPath(PathType user_path);
|
||||
|
||||
// Returns a string containing the current 'User' path.
|
||||
[[nodiscard]] std::string GetUserPathString(PathType user_path);
|
||||
|
||||
// Returns a container with a list of the files inside the specified path.
|
||||
[[nodiscard]] std::vector<FileInfo> ListFilesFromPath(const fs::path &path);
|
||||
|
||||
// Sets the current Path for a given PathType.
|
||||
void SetUserPath(PathType user_path, const fs::path &new_path);
|
||||
|
||||
} // namespace FS
|
||||
} // namespace Base
|
||||
Loading…
Add table
Add a link
Reference in a new issue