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:
parent
485796db48
commit
3f8cda06aa
4 changed files with 21 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue