1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-08-13 14:39:47 +00:00

Improve interface and add some getters.

This commit is contained in:
King_DuckZ 2015-11-06 19:48:02 +00:00
parent 485796db48
commit 3f8cda06aa
4 changed files with 21 additions and 6 deletions

View file

@ -59,10 +59,10 @@ namespace din {
}
} //unnamed namespace
PathName::PathName (const char* parPath) {
if (nullptr != parPath && *parPath != '\0') {
m_absolute = ('/' == *parPath);
std::string path(parPath);
PathName::PathName (boost::string_ref parPath) {
if (not parPath.empty()) {
m_absolute = ('/' == parPath.front());
std::string path(parPath.begin(), parPath.end());
const auto count = count_grouped(path, '/');
const std::size_t trailing = (path.back() == '/' ? 1 : 0);
@ -75,6 +75,7 @@ namespace din {
}
else {
m_original_path = nullptr;
m_absolute = false;
}
}
@ -122,4 +123,8 @@ namespace din {
const boost::string_ref ref(src);
m_pool.insert(ref, &src);
}
void PathName::join (boost::string_ref parOther, const std::string* parSource) {
m_pool.insert(parOther, parSource);
}
} //namespace din