Files
FEX-Emu--FEX/Source/Common/Config.h
T
Ryan Houdek d853de39ff Config: Move path generation to the frontend
This lets all the path generation for the config to be in the frontend.
This then informs FEXCore where things should live.

This is for llvm-mingw. While paths aren't quite generated correctly,
this gets the code closer to compiling.
2023-04-15 15:25:01 -07:00

59 lines
1.7 KiB
C++

#pragma once
#include <FEXCore/Config/Config.h>
#include <FEXCore/fextl/string.h>
/**
* @brief This is a singleton for storing global configuration state
*/
namespace FEX::Config {
class EmptyMapper : public FEXCore::Config::Layer {
public:
explicit EmptyMapper()
: FEXCore::Config::Layer(FEXCore::Config::LayerType::LAYER_MAIN) {
}
void Load() override {}
protected:
};
void SaveLayerToJSON(const fextl::string& Filename, FEXCore::Config::Layer *const Layer);
struct ApplicationNames {
// This is the full path to the program (if it exists).
fextl::string ProgramPath;
// This is the program executable name (if it exists).
fextl::string ProgramName;
};
/**
* @brief Loads the FEX and application configurations for the application that is getting ready to run.
*
* @param NoFEXArguments Do we want to parse FEXLoader arguments, Or is this FEXInterpreter?
* @param LoadProgramConfig Do we want to load application specific configurations?
* @param argc The `argc` passed to main(...)
* @param argv The `argv` passed to main(...)
* @param envp The `envp` passed to main(...)
* @param ExecFDInterp If FEX was executed with binfmt_misc FD argument
* @param ProgramFDFromEnv The execveat FD argument passed through FEX
*
* @return The application name and path structure
*/
ApplicationNames LoadConfig(
bool NoFEXArguments,
bool LoadProgramConfig,
int argc,
char **argv,
char **const envp,
bool ExecFDInterp,
const std::string_view ProgramFDFromEnv
);
const char *GetHomeDirectory();
fextl::string GetDataDirectory();
fextl::string GetConfigDirectory(bool Global);
fextl::string GetConfigFileLocation(bool Global);
void InitializeConfigs();
}