Add -> for directory_iterator
This commit is contained in:
parent
accb6fddcb
commit
2b3728af37
2 changed files with 20 additions and 0 deletions
|
|
@ -85,6 +85,24 @@ namespace fc {
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
class path_wrapper
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
path_wrapper(path p) :
|
||||||
|
_path(p)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
const path* operator->() const
|
||||||
|
{
|
||||||
|
return &_path;
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
path _path;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
class directory_iterator {
|
class directory_iterator {
|
||||||
public:
|
public:
|
||||||
directory_iterator( const fc::path& p );
|
directory_iterator( const fc::path& p );
|
||||||
|
|
@ -92,6 +110,7 @@ namespace fc {
|
||||||
~directory_iterator();
|
~directory_iterator();
|
||||||
|
|
||||||
fc::path operator*()const;
|
fc::path operator*()const;
|
||||||
|
detail::path_wrapper operator->() const;
|
||||||
directory_iterator& operator++(int);
|
directory_iterator& operator++(int);
|
||||||
directory_iterator& operator++();
|
directory_iterator& operator++();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -158,6 +158,7 @@ namespace fc {
|
||||||
directory_iterator::~directory_iterator(){}
|
directory_iterator::~directory_iterator(){}
|
||||||
|
|
||||||
fc::path directory_iterator::operator*()const { return boost::filesystem::path(*(*_p)); }
|
fc::path directory_iterator::operator*()const { return boost::filesystem::path(*(*_p)); }
|
||||||
|
detail::path_wrapper directory_iterator::operator->() const { return detail::path_wrapper(boost::filesystem::path(*(*_p))); }
|
||||||
directory_iterator& directory_iterator::operator++(int) { (*_p)++; return *this; }
|
directory_iterator& directory_iterator::operator++(int) { (*_p)++; return *this; }
|
||||||
directory_iterator& directory_iterator::operator++() { (*_p)++; return *this; }
|
directory_iterator& directory_iterator::operator++() { (*_p)++; return *this; }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue