Remove GetCharArg(). Organize CLI options file.

GetCharArg() was either a hack to keep from segfaulting when using
this botched option parser or it was old forgotten code - or both.

GetCharArg() was not needed because from_string() has std::string
overloaded and every GetCharArg() made its way to from_string().

Note: when using from_string() with std::string, it must be caught!
This commit is contained in:
anonimal 2015-11-14 16:13:08 +00:00
parent 1eff72d525
commit 5ae7e35e80
9 changed files with 60 additions and 46 deletions

View file

@ -63,6 +63,7 @@ http://stackoverflow.com/questions/15660203/inet-pton-identifier-not-found */
namespace i2p {
namespace util {
// TODO: this will be replaced by a real option parser soon.
namespace config {
std::map<std::string, std::string> mapArgs;
std::map<std::string, std::vector<std::string> > mapMultiArgs;

View file

@ -38,12 +38,6 @@ namespace util
*/
std::string GetArg(const std::string& strArg, const std::string& strDefault);
/**
* @return a command line argument from config::mapArgs as a C-style string
* @param nDefault the default value to be returned
*/
const char* GetCharArg(const std::string& strArg, const std::string& nDefault);
/**
* @return true if the argument is set, false otherwise
*/