diff options
Diffstat (limited to 'NorthstarDLL/nsprefix.cpp')
-rw-r--r-- | NorthstarDLL/nsprefix.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/NorthstarDLL/nsprefix.cpp b/NorthstarDLL/nsprefix.cpp index 26f48861..64a9d1f1 100644 --- a/NorthstarDLL/nsprefix.cpp +++ b/NorthstarDLL/nsprefix.cpp @@ -1,38 +1,38 @@ -#include "pch.h"
-#include "nsprefix.h"
-#include <string>
-
-std::string GetNorthstarPrefix()
-{
- return NORTHSTAR_FOLDER_PREFIX;
-}
-
-void InitialiseNorthstarPrefix()
-{
- char* clachar = strstr(GetCommandLineA(), "-profile=");
- if (clachar)
- {
- std::string cla = std::string(clachar);
- if (strncmp(cla.substr(9, 1).c_str(), "\"", 1))
- {
- int space = cla.find(" ");
- std::string dirname = cla.substr(9, space - 9);
- spdlog::info("Found profile in command line arguments: " + dirname);
- NORTHSTAR_FOLDER_PREFIX = dirname;
- }
- else
- {
- std::string quote = "\"";
- int quote1 = cla.find(quote);
- int quote2 = (cla.substr(quote1 + 1)).find(quote);
- std::string dirname = cla.substr(quote1 + 1, quote2);
- spdlog::info("Found profile in command line arguments: " + dirname);
- NORTHSTAR_FOLDER_PREFIX = dirname;
- }
- }
- else
- {
- spdlog::info("Profile was not found in command line arguments. Using default: R2Northstar");
- NORTHSTAR_FOLDER_PREFIX = "R2Northstar";
- }
-}
+#include "pch.h" +#include "nsprefix.h" +#include <string> + +std::string GetNorthstarPrefix() +{ + return NORTHSTAR_FOLDER_PREFIX; +} + +void InitialiseNorthstarPrefix() +{ + char* clachar = strstr(GetCommandLineA(), "-profile="); + if (clachar) + { + std::string cla = std::string(clachar); + if (strncmp(cla.substr(9, 1).c_str(), "\"", 1)) + { + int space = cla.find(" "); + std::string dirname = cla.substr(9, space - 9); + spdlog::info("Found profile in command line arguments: " + dirname); + NORTHSTAR_FOLDER_PREFIX = dirname; + } + else + { + std::string quote = "\""; + int quote1 = cla.find(quote); + int quote2 = (cla.substr(quote1 + 1)).find(quote); + std::string dirname = cla.substr(quote1 + 1, quote2); + spdlog::info("Found profile in command line arguments: " + dirname); + NORTHSTAR_FOLDER_PREFIX = dirname; + } + } + else + { + spdlog::info("Profile was not found in command line arguments. Using default: R2Northstar"); + NORTHSTAR_FOLDER_PREFIX = "R2Northstar"; + } +} |