mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
Adding support for config file
Example: -port=17070 --port=17070 cat /home/$USER/.i2pd/i2p.conf port=17070
This commit is contained in:
parent
0e5bbfa21c
commit
d95b4befaa
4 changed files with 206 additions and 55 deletions
24
util.h
24
util.h
|
@ -4,14 +4,30 @@
|
|||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#define PAIRTYPE(t1, t2) std::pair<t1, t2>
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
extern std::map<std::string, std::string> mapArgs;
|
||||
void OptionParser(int argc, const char* const argv[]);
|
||||
int GetIntArg(const std::string& strArg, int nDefault);
|
||||
const char* GetCharArg(const std::string& strArg, const std::string& nDefault);
|
||||
namespace config
|
||||
{
|
||||
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[]);
|
||||
int GetArg(const std::string& strArg, int nDefault);
|
||||
std::string GetArg(const std::string& strArg, const std::string& strDefault);
|
||||
const char* GetCharArg(const std::string& strArg, const std::string& nDefault);
|
||||
}
|
||||
|
||||
namespace filesystem
|
||||
{
|
||||
boost::filesystem::path GetDefaultDataDir();
|
||||
boost::filesystem::path GetConfigFile();
|
||||
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet,
|
||||
std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
|
||||
}
|
||||
|
||||
namespace http
|
||||
{
|
||||
std::string httpRequest(const std::string& address);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue