MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / GetDataDirectory

Function GetDataDirectory

Source/Common/Config.cpp:548–570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546#endif
547
548fextl::string GetDataDirectory(bool Global, const PortableInformation& PortableInfo) {
549 const char* DataOverride = getenv("FEX_APP_DATA_LOCATION");
550
551 if (PortableInfo.IsPortable && (Global || !DataOverride)) {
552 return fextl::fmt::format("{}/fex-emu/", PortableInfo.InterpreterPath);
553 }
554
555 fextl::string DataDir {};
556 if (Global) {
557 DataDir = GLOBAL_DATA_DIRECTORY;
558 } else {
559 const char* HomeDir = GetHomeDirectory();
560 const char* DataXDG = getenv("XDG_DATA_HOME");
561 if (DataOverride) {
562 // Data override will override the complete directory
563 DataDir = DataOverride;
564 } else {
565 DataDir = DataXDG ?: HomeDir;
566 DataDir += "/.fex-emu/";
567 }
568 }
569 return DataDir;
570}
571
572fextl::string GetConfigDirectory(bool Global, const PortableInformation& PortableInfo) {
573 const char* ConfigOverride = getenv("FEX_APP_CONFIG_LOCATION");

Callers 11

Config.cppFile · 0.85
GetServerLockFolderFunction · 0.85
InitializeConfigsFunction · 0.85
GenerateMapMethod · 0.85
ValidateCheckExistsFunction · 0.85
mainFunction · 0.85
ConfigInitFunction · 0.85
RootFSModelMethod · 0.85
ReloadMethod · 0.85
getBaseUrlMethod · 0.85

Calls 3

getenvFunction · 0.85
formatFunction · 0.85
GetHomeDirectoryFunction · 0.85

Tested by

no test coverage detected