Browse Source

* drop mapMultiArgs : it's not used anywhere

pull/326/head
hagen 9 years ago
parent
commit
1d5194a138
  1. 2
      Daemon.cpp
  2. 7
      util.cpp
  3. 4
      util.h

2
Daemon.cpp

@ -65,7 +65,7 @@ namespace i2p
LogPrint(eLogInfo, "i2pd v", VERSION, " starting"); LogPrint(eLogInfo, "i2pd v", VERSION, " starting");
LogPrint(eLogDebug, "FS: data directory: ", i2p::util::filesystem::GetDataDir().string()); LogPrint(eLogDebug, "FS: data directory: ", i2p::util::filesystem::GetDataDir().string());
i2p::util::filesystem::ReadConfigFile(i2p::util::config::mapArgs, i2p::util::config::mapMultiArgs); i2p::util::filesystem::ReadConfigFile(i2p::util::config::mapArgs);
isDaemon = i2p::util::config::GetArg("-daemon", 0); isDaemon = i2p::util::config::GetArg("-daemon", 0);
isLogging = i2p::util::config::GetArg("-log", 1); isLogging = i2p::util::config::GetArg("-log", 1);

7
util.cpp

@ -70,12 +70,10 @@ namespace util
namespace config namespace config
{ {
std::map<std::string, std::string> mapArgs; std::map<std::string, std::string> mapArgs;
std::map<std::string, std::vector<std::string> > mapMultiArgs;
void OptionParser(int argc, const char* const argv[]) void OptionParser(int argc, const char* const argv[])
{ {
mapArgs.clear(); mapArgs.clear();
mapMultiArgs.clear();
for (int i = 1; i < argc; i++) for (int i = 1; i < argc; i++)
{ {
std::string strKey (argv[i]); std::string strKey (argv[i]);
@ -96,7 +94,6 @@ namespace config
break; break;
mapArgs[strKey] = strValue; mapArgs[strKey] = strValue;
mapMultiArgs[strKey].push_back(strValue);
} }
BOOST_FOREACH(PAIRTYPE(const std::string,std::string)& entry, mapArgs) BOOST_FOREACH(PAIRTYPE(const std::string,std::string)& entry, mapArgs)
@ -196,8 +193,7 @@ namespace filesystem
return pathTunnelsConfigFile; return pathTunnelsConfigFile;
} }
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet)
std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet)
{ {
boost::filesystem::ifstream streamConfig(GetConfigFile()); boost::filesystem::ifstream streamConfig(GetConfigFile());
if (!streamConfig.good()) if (!streamConfig.good())
@ -214,7 +210,6 @@ namespace filesystem
{ {
mapSettingsRet[strKey] = it->value[0]; mapSettingsRet[strKey] = it->value[0];
} }
mapMultiSettingsRet[strKey].push_back(it->value[0]);
} }
} }

4
util.h

@ -17,7 +17,6 @@ namespace util
namespace config namespace config
{ {
extern std::map<std::string, std::string> mapArgs; extern std::map<std::string, std::string> mapArgs;
extern std::map<std::string, std::vector<std::string> > mapMultiArgs;
void OptionParser(int argc, const char* const argv[]); void OptionParser(int argc, const char* const argv[]);
int GetArg(const std::string& strArg, int nDefault); int GetArg(const std::string& strArg, int nDefault);
std::string GetArg(const std::string& strArg, const std::string& strDefault); std::string GetArg(const std::string& strArg, const std::string& strDefault);
@ -34,8 +33,7 @@ namespace util
boost::filesystem::path GetDefaultDataDir(); boost::filesystem::path GetDefaultDataDir();
boost::filesystem::path GetConfigFile(); boost::filesystem::path GetConfigFile();
boost::filesystem::path GetTunnelsConfigFile(); boost::filesystem::path GetTunnelsConfigFile();
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet);
std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
boost::filesystem::path GetCertificatesDir(); boost::filesystem::path GetCertificatesDir();
} }

Loading…
Cancel
Save