local addresses

This commit is contained in:
orignal 2016-03-16 15:40:29 -04:00
parent 7c8036807a
commit 803f11bebb
3 changed files with 54 additions and 19 deletions

15
FS.h
View file

@ -48,8 +48,8 @@ namespace fs {
/** create subdirs in storage */
bool Init(const char* chars, size_t cnt);
const std::string & GetRoot() const { return this->root; }
const std::string & GetName() const { return this->name; }
const std::string & GetRoot() const { return root; }
const std::string & GetName() const { return name; }
/** set directory where to place storage directory */
void SetPlace(const std::string & path);
/** path to file with given ident */
@ -138,6 +138,17 @@ namespace fs {
return s.str();
}
template<typename Storage, typename... Filename>
std::string StorageRootPath (const Storage& storage, Filename... filenames)
{
std::stringstream s("");
s << storage.GetRoot ();
_ExpandPath(s, filenames...);
return s.str();
}
} // fs
} // i2p