i2pd/AddressBook.h

39 lines
705 B
C
Raw Normal View History

2014-03-13 22:22:32 +04:00
#ifndef ADDRESS_BOOK_H__
#define ADDRESS_BOOK_H__
#include <string.h>
#include <string>
#include <map>
#include "base64.h"
#include "util.h"
#include "Identity.h"
#include "Log.h"
namespace i2p
{
2014-10-24 23:22:36 +04:00
namespace client
2014-03-13 22:22:32 +04:00
{
class AddressBook
{
public:
2014-04-01 23:18:14 +04:00
AddressBook ();
2014-10-24 23:22:36 +04:00
bool GetIdentHash (const std::string& address, i2p::data::IdentHash& ident);
const i2p::data::IdentHash * FindAddress (const std::string& address);
2014-09-23 23:38:56 +04:00
void InsertAddress (const std::string& address, const std::string& base64); // for jump service
2014-03-13 22:22:32 +04:00
private:
2014-04-01 23:18:14 +04:00
void LoadHosts ();
void LoadHostsFromI2P ();
2014-03-13 22:22:32 +04:00
2014-10-24 23:22:36 +04:00
std::map<std::string, i2p::data::IdentHash> m_Addresses;
bool m_IsLoaded, m_IsDowloading;
2014-03-13 22:22:32 +04:00
};
}
}
#endif