MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetDocsPath

Function GetDocsPath

src/openrct2/platform/Platform.Linux.cpp:107–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105 }
106
107 std::string GetDocsPath()
108 {
109 std::string relative = Path::GetDirectory(Platform::GetCurrentExecutablePath());
110 relative = Path::Combine(relative, u8"../share/doc/openrct2");
111 const utf8* searchLocations[] = {
112 // First try the directory relative to the executable
113 relative.c_str(),
114 "./doc",
115 "/usr/share/doc/openrct2",
116 DOCDIR,
117 };
118 for (auto searchLocation : searchLocations)
119 {
120 LOG_VERBOSE("Looking for OpenRCT2 doc path at %s", searchLocation);
121 if (Path::DirectoryExists(searchLocation))
122 {
123 LOG_VERBOSE("Found OpenRCT2 doc path at %s", searchLocation);
124 return searchLocation;
125 }
126 }
127 return std::string();
128 }
129
130 static std::string GetCurrentWorkingDirectory()
131 {

Callers 1

Calls 4

GetDirectoryFunction · 0.85
DirectoryExistsFunction · 0.85
GetCurrentExecutablePathFunction · 0.70
CombineFunction · 0.50

Tested by

no test coverage detected