diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/PropertiesI.cpp | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index 815c326d082..8454ac62371 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -223,131 +223,6 @@ Ice::PropertiesI::PropertiesI(int& argc, char* argv[]) } } -#if 0 -Ice::PropertiesI::PropertiesI(int& argc, char* argv[]) -{ - for (int i = 1; i < argc; ++i) - { - if (strncmp(argv[i], "--Ice.Config", 12) == 0) - { - string line = argv[i]; - if (line.find('=') == string::npos) - { - line += "=1"; - } - parseLine(line.substr(2)); - } - } - - string file = getProperty("Ice.Config"); - - if (file.empty() || file == "1") - { - const char* s = getenv("ICE_CONFIG"); - if (s && *s != '\0') - { - file = s; - } - } - - if (!file.empty()) - { - load(file); - } - - parseArgs(argc, argv); - setProperty("Ice.Config", file); -} - -Ice::PropertiesI::PropertiesI(int& argc, char* argv[], const string& file) -{ - if (!file.empty()) - { - load(file); - } - - parseArgs(argc, argv); - setProperty("Ice.Config", file); -} - -void -Ice::PropertiesI::parseArgs(int& argc, char* argv[]) -{ - if (!argv) - { - return; - } - - if (argc > 0) - { - string name = getProperty("Ice.ProgramName"); - if (name.empty()) - { - setProperty("Ice.ProgramName", argv[0]); - } - } - - int idx = 1; - while (idx < argc) - { - bool match = false; - string arg = argv[idx]; - string::size_type beg = arg.find("--"); - if (beg == 0) - { - string rest = arg.substr(2); - if (rest.find("Ice.") == 0) - { - match = true; - } - else - { - set<string>::const_iterator p; - for (p = _argumentPrefixes.begin(); p != _argumentPrefixes.end(); ++p) - { - if (rest.find((*p) + ".") == 0) - { - match = true; - break; - } - } - } - - if (match) - { - for (int i = idx ; i + 1 < argc ; ++i) - { - argv[i] = argv[i + 1]; - } - --argc; - - if (arg.find('=') == string::npos) - { - arg += "=1"; - } - - parseLine(arg.substr(2)); - } - } - - if (!match) - { - ++idx; - } - } -} - -void -Ice::PropertiesI::parse(istream& in) -{ - char line[1024]; - while (in.getline(line, 1024)) - { - parseLine(line); - } -} -#endif - void Ice::PropertiesI::parseLine(const string& line) { |