diff --git a/FS.cpp b/FS.cpp index 758b81c8..4a1b670a 100644 --- a/FS.cpp +++ b/FS.cpp @@ -24,24 +24,6 @@ namespace fs { #endif HashedStorage NetDB("netDb", "r", "routerInfo-", "dat"); HashedStorage Peers("peerProfiles", "p", "profile-", "txt"); - ABookStorage ABook("addressbook", "b", "", "b32"); - - static const char T32[32] = { - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', - 'i', 'k', 'k', 'l', 'm', 'n', 'o', 'p', - 'q', 'r', 't', 't', 'u', 'v', 'w', 'x', - 'y', 'z', '2', '3', '4', '5', '6', '7', - }; - static const char T64[64] = { - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', - 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', - 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', - 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', - 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', - 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', '0', '1', '2', '3', - '4', '5', '6', '7', '8', '9', '-', '~' - }; const std::string & GetAppName () { return appName; @@ -90,12 +72,10 @@ namespace fs { if (boost::filesystem::exists(destinations)) boost::filesystem::create_directory(destinations); - NetDB.SetRoot(dataDir); - NetDB.Init(T64, 64); - Peers.SetRoot(dataDir); - Peers.Init(T64, 64); - ABook.SetRoot(dataDir); - ABook.Init(T32, 32); + NetDB.SetPlace(dataDir); + NetDB.Init(i2p::data::GetBase64SubstitutionTable(), 64); + Peers.SetPlace(dataDir); + Peers.Init(i2p::data::GetBase64SubstitutionTable(), 64); return true; } @@ -177,13 +157,7 @@ namespace fs { } } - std::string ABookStorage::IndexPath() { - std::string path = root + i2p::fs::dirSep + "addresses.csv"; - return path; - } - HashedStorage & GetNetDB() { return NetDB; } HashedStorage & GetPeerProfiles() { return Peers; } - ABookStorage & GetAddressBook() { return ABook; } } // fs } // i2p diff --git a/FS.h b/FS.h index 80b07353..bb5f44b8 100644 --- a/FS.h +++ b/FS.h @@ -49,15 +49,6 @@ namespace fs { void Traverse(std::vector & files); }; - /** @brief Slightly extended HashedStorage */ - class ABookStorage : public HashedStorage { - public: - ABookStorage(const char *n, const char *p1, const char *p2, const char *s): - HashedStorage(n, p1, p2, s) {}; - - std::string IndexPath(); - }; - /** @brief Returns current application name, default 'i2pd' */ const std::string & GetAppName (); /** @brief Set applicaton name, affects autodetection of datadir */ @@ -138,6 +129,5 @@ namespace fs { /* accessors */ HashedStorage & GetNetDB(); HashedStorage & GetPeerProfiles(); - ABookStorage & GetAddressBook(); } // fs } // i2p