#include #include #include #include #include "MiscSupport.h" #include "GlobalConfigFile.h" static bool writePhaseFinished = false; static PropertyList configItems; static void addConfigItemsImpl(std::string encoded) { parseUrlRequest(configItems, encoded); } void addConfigItems(std::string encoded) { addConfigItemsImpl(encoded); assert(!writePhaseFinished); } bool addConfigItemsFromFile(std::string fileName) { std::ifstream file(fileName.c_str()); while (true) { if (file.eof()) { break; } if (!file) { return false; } std::string line; file>>line; if (!line.empty()) { addConfigItemsImpl(line); } } assert(!writePhaseFinished); return true; } bool addConfigItemsFromCommandLine(char *argv[]) { while(argv[0]) { if (!strcmp(argv[0], "-f")) { if (!argv[1]) { std::cerr<<"Expecting file to go with -f\n"; return false; } if (!addConfigItemsFromFile(argv[1])) { std::cerr<<"Error reading config file \""<