blob: 1ed345efab94853a769a796414a0e2ac0e4290fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include <string>
#include "pch.h"
#include "configurables.h"
std::string GetNorthstarPrefix() {
return NORTHSTAR_FOLDER_PREFIX;
}
void parseConfigurables() {
char* clachar = strstr(GetCommandLineA(), "-profile=");
if (clachar) {
std::string cla = std::string(clachar);
if (strcmp(cla.substr(9, 1).c_str(), "\"")) {
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("Didnt' find profile in command line arguments. Using default: R2Northstar");
NORTHSTAR_FOLDER_PREFIX = "R2Northstar";
}
}
|