1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-08-22 16:00:50 +00:00

Add level offset.

The level in the FileRecordData is 0 at the base of the
directory being scanned. However PathName::atom_count() can be
more than that. For example scanning /mnt/cdrom will have
level 0 at the mount point, but atom_count() is 2. So it's
necessary to pass in this offset. This way the code can take
that into account and compute stuff correctly.
This commit is contained in:
King_DuckZ 2016-02-16 20:18:10 +00:00
parent 5908828390
commit 5fbad40fda
3 changed files with 34 additions and 23 deletions

View file

@ -60,7 +60,7 @@ namespace mchlib {
DirIterator ( DirIterator<Const>&& parOther );
template <bool OtherConst>
DirIterator ( DirIterator<OtherConst>&& parOther, typename std::enable_if<std::is_convertible<typename DirIterator<OtherConst>::VecIterator, VecIterator>::value, enabler>::type = enabler() );
DirIterator ( VecIterator parBegin, VecIterator parEnd, std::unique_ptr<PathName>&& parBasePath );
DirIterator ( VecIterator parBegin, VecIterator parEnd, std::unique_ptr<PathName>&& parBasePath, std::size_t parLevelOffset );
~DirIterator ( void ) noexcept;
private:
@ -75,6 +75,7 @@ namespace mchlib {
VecIterator m_current;
VecIterator m_end;
std::unique_ptr<PathName> m_base_path;
std::size_t m_level_offset;
};
};
@ -87,7 +88,7 @@ namespace mchlib {
typedef typename implem::DirIterator<Const>::VecIterator list_iterator;
explicit SetListingView ( const implem::DirIterator<Const>& parIter );
SetListingView ( list_iterator parBeg, list_iterator parEnd );
SetListingView ( list_iterator parBeg, list_iterator parEnd, std::size_t parLevelOffset );
SetListingView ( SetListingView&& ) = default;
~SetListingView ( void ) noexcept = default;
@ -103,6 +104,7 @@ namespace mchlib {
private:
list_iterator m_begin;
list_iterator m_end;
std::size_t m_level_offset;
};
class SetListing {