25 #ifndef INCLUDED_LocateServer_h_GUID_7D10F12E_2A83_48BB_7581_ED7A7F5188AC
26 #define INCLUDED_LocateServer_h_GUID_7D10F12E_2A83_48BB_7581_ED7A7F5188AC
43 inline boost::optional<std::string> getServerBinaryDirectoryPath() {
45 if (!server || server->empty()) {
48 const char lastChar = server->back();
49 if (lastChar ==
'/' || lastChar ==
'\\') {
56 inline boost::optional<std::string> getServerBinaryPath() {
57 const auto binPath = getServerBinaryDirectoryPath();
59 #if defined(OSVR_WINDOWS)
60 static const std::string pathExtension =
".exe";
61 static const std::string pathSep =
"\\";
63 static const std::string pathExtension =
"";
64 static const std::string pathSep =
"/";
66 return *binPath + pathSep +
"osvr_server" + pathExtension;
72 inline boost::optional<std::string> getServerLauncherBinaryPath() {
73 return getServerBinaryPath();
78 #endif // INCLUDED_LocateServer_h_GUID_7D10F12E_2A83_48BB_7581_ED7A7F5188AC
boost::optional< std::string > getEnvironmentVariable(std::string const &var)
Gets an environment variable's value. On systems that don't distinguish between having a variable def...