someone on windows check if the getenv thing works

master
ieee 802.11ac 2 years ago
parent eba90f86dd
commit d36c909b87

@ -1,5 +1,6 @@
#ifndef JSON_MAINPARSER_H
#define JSON_MAINPARSER_H
#include <iostream>
class jsonObject {
private:
FILE* loadedFile;

@ -6,10 +6,14 @@ behold! my garbage code. (and other people's better code but whatever)
#include <string.h>
#ifdef __linux__
char* defaultPath = "$HOME/.config/factorioclone";
std::string defaultPath = "$HOME/.config/factorioclone";
#endif
#ifdef __WIN32__
#include <windows.h>
char* defaultPath = getenv("APPDATA");
#endif
char* filename = "main";
std::string filename = "main";
int main(int argc, char **argv)
{
@ -30,6 +34,8 @@ int main(int argc, char **argv)
std::cout << "syntax: " << filename << " [arguments] <*.json>" << std::endl; // why json? because 1. it's convenient and 2. i'm too lazy to make a blotterv5 parser
break;
} else if (!strcmp(arg, "--debug")) {
std::cout << "default path: " << defaultPath << std::endl;
}
}
}

Loading…
Cancel
Save