CppCommon  1.0.4.1
C++ Common Library
directory_iterator.h
Go to the documentation of this file.
1 
9 #ifndef CPPCOMMON_FILESYSTEM_DIRECTORY_ITERATOR_H
10 #define CPPCOMMON_FILESYSTEM_DIRECTORY_ITERATOR_H
11 
12 #include "filesystem/path.h"
13 
14 #include <memory>
15 
16 namespace CppCommon {
17 
19 
28 {
29  friend class Directory;
30 
31 public:
32  // Standard constant iterator type definitions
33  typedef std::ptrdiff_t difference_type;
34  typedef Path value_type;
35  typedef const Path& reference;
36  typedef const Path* pointer;
37  typedef std::forward_iterator_tag iterator_category;
38 
41  DirectoryIterator(DirectoryIterator&& it) noexcept;
43 
46 
47  friend bool operator==(const DirectoryIterator& it1, const DirectoryIterator& it2) noexcept;
48  friend bool operator!=(const DirectoryIterator& it1, const DirectoryIterator& it2) noexcept;
49 
52 
53  const Path& operator*() const noexcept;
54  const Path* operator->() const noexcept;
55 
57  void swap(DirectoryIterator& it) noexcept;
58  friend void swap(DirectoryIterator& it1, DirectoryIterator& it2) noexcept;
59 
60 private:
61  class Impl;
62  class SimpleImpl;
63  class RecursiveImpl;
64  std::unique_ptr<Impl> _pimpl;
65  Path _current;
66 
67  DirectoryIterator(const Path& current);
68  DirectoryIterator(const Path& parent, bool recursive);
69 };
70 
71 } // namespace CppCommon
72 
73 #include "directory_iterator.inl"
74 
75 #endif // CPPCOMMON_FILESYSTEM_DIRECTORY_ITERATOR_H
Filesystem directory.
Definition: directory.h:25
Filesystem directory iterator.
friend bool operator!=(const DirectoryIterator &it1, const DirectoryIterator &it2) noexcept
DirectoryIterator & operator=(DirectoryIterator &it)
DirectoryIterator & operator++()
friend bool operator==(const DirectoryIterator &it1, const DirectoryIterator &it2) noexcept
std::forward_iterator_tag iterator_category
const Path & operator*() const noexcept
void swap(DirectoryIterator &it) noexcept
Swap two instances.
Filesystem path.
Definition: path.h:90
C++ Common project definitions.
Definition: token_bucket.h:15
Filesystem path definition.