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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### `recursive_directory_iterator` members <a id="fs.rec.dir.itr.members">[[fs.rec.dir.itr.members]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
recursive_directory_iterator() noexcept;
|
| 5 |
+
```
|
| 6 |
+
|
| 7 |
+
*Effects:* Constructs the end iterator.
|
| 8 |
+
|
| 9 |
+
``` cpp
|
| 10 |
+
explicit recursive_directory_iterator(const path& p);
|
| 11 |
+
recursive_directory_iterator(const path& p, directory_options options);
|
| 12 |
+
recursive_directory_iterator(const path& p, directory_options options, error_code& ec) noexcept;
|
| 13 |
+
recursive_directory_iterator(const path& p, error_code& ec) noexcept;
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
*Effects:* Constructs a iterator representing the first entry in the
|
| 17 |
+
directory `p` resolves to, if any; otherwise, the end iterator. However,
|
| 18 |
+
if
|
| 19 |
+
|
| 20 |
+
``` cpp
|
| 21 |
+
(options & directory_options::skip_permission_denied) != directory_options::none
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
and construction encounters an error indicating that permission to
|
| 25 |
+
access `p` is denied, constructs the end iterator and does not report an
|
| 26 |
+
error.
|
| 27 |
+
|
| 28 |
+
*Postconditions:* `options() == options` for the signatures with a
|
| 29 |
+
`directory_options` argument, otherwise
|
| 30 |
+
`options() == directory_options::none`.
|
| 31 |
+
|
| 32 |
+
*Throws:* As specified in [[fs.err.report]].
|
| 33 |
+
|
| 34 |
+
[*Note 1*: To iterate over the current directory, use
|
| 35 |
+
`recursive_directory_iterator(".")` rather than
|
| 36 |
+
`recursive_directory_iterator("")`. — *end note*]
|
| 37 |
+
|
| 38 |
+
[*Note 2*: By default, `recursive_directory_iterator` does not follow
|
| 39 |
+
directory symlinks. To follow directory symlinks, specify `options` as
|
| 40 |
+
`directory_options::follow_directory_symlink` — *end note*]
|
| 41 |
+
|
| 42 |
+
``` cpp
|
| 43 |
+
recursive_directory_iterator(const recursive_directory_iterator& rhs);
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
*Effects:* Constructs an object of class `recursive_directory_iterator`.
|
| 47 |
+
|
| 48 |
+
*Postconditions:*
|
| 49 |
+
|
| 50 |
+
- `options() == rhs.options()`
|
| 51 |
+
- `depth() == rhs.depth()`
|
| 52 |
+
- `recursion_pending() == rhs.recursion_pending()`
|
| 53 |
+
|
| 54 |
+
``` cpp
|
| 55 |
+
recursive_directory_iterator(recursive_directory_iterator&& rhs) noexcept;
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
*Effects:* Constructs an object of class `recursive_directory_iterator`.
|
| 59 |
+
|
| 60 |
+
*Postconditions:* `options()`, `depth()`, and `recursion_pending()` have
|
| 61 |
+
the values that `rhs.options()`, `rhs.depth()`, and
|
| 62 |
+
`rhs.recursion_pending()`, respectively, had before the function call.
|
| 63 |
+
|
| 64 |
+
``` cpp
|
| 65 |
+
recursive_directory_iterator& operator=(const recursive_directory_iterator& rhs);
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
*Effects:* If `*this` and `rhs` are the same object, the member has no
|
| 69 |
+
effect.
|
| 70 |
+
|
| 71 |
+
*Postconditions:*
|
| 72 |
+
|
| 73 |
+
- `options() == rhs.options()`
|
| 74 |
+
- `depth() == rhs.depth()`
|
| 75 |
+
- `recursion_pending() == rhs.recursion_pending()`
|
| 76 |
+
|
| 77 |
+
*Returns:* `*this`.
|
| 78 |
+
|
| 79 |
+
``` cpp
|
| 80 |
+
recursive_directory_iterator& operator=(recursive_directory_iterator&& rhs) noexcept;
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
*Effects:* If `*this` and `rhs` are the same object, the member has no
|
| 84 |
+
effect.
|
| 85 |
+
|
| 86 |
+
*Postconditions:* `options()`, `depth()`, and `recursion_pending()` have
|
| 87 |
+
the values that `rhs.options()`, `rhs.depth()`, and
|
| 88 |
+
`rhs.recursion_pending()`, respectively, had before the function call.
|
| 89 |
+
|
| 90 |
+
*Returns:* `*this`.
|
| 91 |
+
|
| 92 |
+
``` cpp
|
| 93 |
+
directory_options options() const;
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
*Returns:* The value of the argument passed to the constructor for the
|
| 97 |
+
`options` parameter, if present, otherwise `directory_options::none`.
|
| 98 |
+
|
| 99 |
+
*Throws:* Nothing.
|
| 100 |
+
|
| 101 |
+
``` cpp
|
| 102 |
+
int depth() const;
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
*Returns:* The current depth of the directory tree being traversed.
|
| 106 |
+
|
| 107 |
+
[*Note 3*: The initial directory is depth `0`, its immediate
|
| 108 |
+
subdirectories are depth `1`, and so forth. — *end note*]
|
| 109 |
+
|
| 110 |
+
*Throws:* Nothing.
|
| 111 |
+
|
| 112 |
+
``` cpp
|
| 113 |
+
bool recursion_pending() const;
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
*Returns:* `true` if `disable_recursion_pending()` has not been called
|
| 117 |
+
subsequent to the prior construction or increment operation, otherwise
|
| 118 |
+
`false`.
|
| 119 |
+
|
| 120 |
+
*Throws:* Nothing.
|
| 121 |
+
|
| 122 |
+
``` cpp
|
| 123 |
+
recursive_directory_iterator& operator++();
|
| 124 |
+
recursive_directory_iterator& increment(error_code& ec) noexcept;
|
| 125 |
+
```
|
| 126 |
+
|
| 127 |
+
*Effects:* As specified for the prefix increment operation of Input
|
| 128 |
+
iterators ([[input.iterators]]), except that:
|
| 129 |
+
|
| 130 |
+
- If there are no more entries at the current depth, then if
|
| 131 |
+
`depth() != 0` iteration over the parent directory resumes; otherwise
|
| 132 |
+
`*this = recursive_directory_iterator()`.
|
| 133 |
+
- Otherwise if
|
| 134 |
+
``` cpp
|
| 135 |
+
recursion_pending() && is_directory((*this)->status()) &&
|
| 136 |
+
(!is_symlink((*this)->symlink_status()) ||
|
| 137 |
+
(options() & directory_options::follow_directory_symlink) != directory_options::none)
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
then either directory `(*this)->path()` is recursively iterated into
|
| 141 |
+
or, if
|
| 142 |
+
``` cpp
|
| 143 |
+
(options() & directory_options::skip_permission_denied) != directory_options::none
|
| 144 |
+
```
|
| 145 |
+
|
| 146 |
+
and an error occurs indicating that permission to access directory
|
| 147 |
+
`(*this)->path()` is denied, then directory `(*this)->path()` is
|
| 148 |
+
treated as an empty directory and no error is reported.
|
| 149 |
+
|
| 150 |
+
*Returns:* `*this`.
|
| 151 |
+
|
| 152 |
+
*Throws:* As specified in [[fs.err.report]].
|
| 153 |
+
|
| 154 |
+
``` cpp
|
| 155 |
+
void pop();
|
| 156 |
+
void pop(error_code& ec);
|
| 157 |
+
```
|
| 158 |
+
|
| 159 |
+
*Effects:* If `depth() == 0`, set `*this` to
|
| 160 |
+
`recursive_directory_iterator()`. Otherwise, cease iteration of the
|
| 161 |
+
directory currently being iterated over, and continue iteration over the
|
| 162 |
+
parent directory.
|
| 163 |
+
|
| 164 |
+
*Throws:* As specified in [[fs.err.report]].
|
| 165 |
+
|
| 166 |
+
``` cpp
|
| 167 |
+
void disable_recursion_pending();
|
| 168 |
+
```
|
| 169 |
+
|
| 170 |
+
*Postconditions:* `recursion_pending() == false`.
|
| 171 |
+
|
| 172 |
+
[*Note 4*: `disable_recursion_pending``()` is used to prevent unwanted
|
| 173 |
+
recursion into a directory. — *end note*]
|
| 174 |
+
|