30#ifndef _GLIBCXX_FS_DIR_H
31#define _GLIBCXX_FS_DIR_H 1
33#if __cplusplus >= 201703L
37# include <bits/shared_ptr.h>
39#if __cplusplus >= 202002L
44namespace std _GLIBCXX_VISIBILITY(default)
46_GLIBCXX_BEGIN_NAMESPACE_VERSION
63 : _M_type(__ft), _M_perms(__prms) { }
73 file_type type()
const noexcept {
return _M_type; }
74 perms permissions()
const noexcept {
return _M_perms; }
77 void type(
file_type __ft)
noexcept { _M_type = __ft; }
78 void permissions(
perms __prms)
noexcept { _M_perms = __prms; }
80#if __cpp_lib_three_way_comparison
90_GLIBCXX_BEGIN_NAMESPACE_CXX11
141 _M_path.replace_filename(__p);
148 _M_path.replace_filename(__p);
154 { _M_type = symlink_status().type(); }
158 { _M_type = symlink_status(__ec).type(); }
166 {
return filesystem::exists(
file_status{_M_file_type()}); }
170 {
return filesystem::exists(
file_status{_M_file_type(__ec)}); }
173 is_block_file()
const
174 {
return _M_file_type() == file_type::block; }
177 is_block_file(
error_code& __ec)
const noexcept
178 {
return _M_file_type(__ec) == file_type::block; }
181 is_character_file()
const
182 {
return _M_file_type() == file_type::character; }
185 is_character_file(
error_code& __ec)
const noexcept
186 {
return _M_file_type(__ec) == file_type::character; }
190 {
return _M_file_type() == file_type::directory; }
194 {
return _M_file_type(__ec) == file_type::directory; }
198 {
return _M_file_type() == file_type::fifo; }
202 {
return _M_file_type(__ec) == file_type::fifo; }
206 {
return filesystem::is_other(
file_status{_M_file_type()}); }
210 {
return filesystem::is_other(
file_status{_M_file_type(__ec)}); }
213 is_regular_file()
const
214 {
return _M_file_type() == file_type::regular; }
217 is_regular_file(
error_code& __ec)
const noexcept
218 {
return _M_file_type(__ec) == file_type::regular; }
222 {
return _M_file_type() == file_type::socket; }
226 {
return _M_file_type(__ec) == file_type::socket; }
231 if (_M_type != file_type::none)
232 return _M_type == file_type::symlink;
233 return symlink_status().type() == file_type::symlink;
239 if (_M_type != file_type::none)
240 return _M_type == file_type::symlink;
241 return symlink_status(__ec).type() == file_type::symlink;
246 {
return filesystem::file_size(_M_path); }
250 {
return filesystem::file_size(_M_path, __ec); }
253 hard_link_count()
const
254 {
return filesystem::hard_link_count(_M_path); }
257 hard_link_count(
error_code& __ec)
const noexcept
258 {
return filesystem::hard_link_count(_M_path, __ec); }
261 last_write_time()
const
262 {
return filesystem::last_write_time(_M_path); }
266 last_write_time(
error_code& __ec)
const noexcept
267 {
return filesystem::last_write_time(_M_path, __ec); }
271 {
return filesystem::status(_M_path); }
275 {
return filesystem::status(_M_path, __ec); }
278 symlink_status()
const
279 {
return filesystem::symlink_status(_M_path); }
282 symlink_status(
error_code& __ec)
const noexcept
283 {
return filesystem::symlink_status(_M_path, __ec); }
287 {
return _M_path == __rhs._M_path; }
289#if __cpp_lib_three_way_comparison
292 {
return _M_path <=> __rhs._M_path; }
296 {
return _M_path != __rhs._M_path; }
300 {
return _M_path < __rhs._M_path; }
304 {
return _M_path <= __rhs._M_path; }
308 {
return _M_path > __rhs._M_path; }
312 {
return _M_path >= __rhs._M_path; }
322 template<
typename _CharT,
typename _Traits>
326 {
return __os << __d.path(); }
329 : _M_path(__p), _M_type(__t)
336 if (_M_type != file_type::none && _M_type != file_type::symlink)
338 return status().type();
345 if (_M_type != file_type::none && _M_type != file_type::symlink)
350 return status(__ec).type();
360 const directory_entry& operator*()
const&
noexcept {
return _M_entry; }
379 typedef ptrdiff_t difference_type;
428 return !__rhs._M_dir.owner_before(__lhs._M_dir)
429 && !__lhs._M_dir.owner_before(__rhs._M_dir);
432#if __cplusplus >= 202002L
439#if __cpp_impl_three_way_comparison < 201907L
443 {
return !(__lhs == __rhs); }
451 std::__shared_ptr<_Dir> _M_dir;
475 typedef ptrdiff_t difference_type;
505 int depth()
const noexcept;
506 bool recursion_pending()
const noexcept;
530 void disable_recursion_pending()
noexcept;
536 return !__rhs._M_dirs.owner_before(__lhs._M_dirs)
537 && !__lhs._M_dirs.owner_before(__rhs._M_dirs);
540#if __cplusplus >= 202002L
547#if __cpp_impl_three_way_comparison < 201907L
551 {
return !(__lhs == __rhs); }
558 std::__shared_ptr<_Dir_stack> _M_dirs;
566 filesystem::remove_all(
const path&);
585_GLIBCXX_END_NAMESPACE_CXX11
593 extern template class
594 __shared_ptr<filesystem::_Dir>;
595 extern template class
596 __shared_ptr<filesystem::recursive_directory_iterator::_Dir_stack>;
598_GLIBCXX_END_NAMESPACE_VERSION
recursive_directory_iterator end(recursive_directory_iterator) noexcept
Return a past-the-end recursive_directory_iterator.
directory_iterator end(directory_iterator) noexcept
Return a past-the-end directory_iterator.
directory_iterator begin(directory_iterator __iter) noexcept
Enable range-based for using directory_iterator.
perms
Bitmask type representing file access permissions.
directory_options
Bitmask type controlling directory iteration.
file_type
Enumerated type representing the type of a file.
recursive_directory_iterator begin(recursive_directory_iterator __iter) noexcept
Enable range-based for using recursive_directory_iterator.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
ISO C++ entities toplevel namespace is std.
Template class basic_ostream.
chrono::time_point represents a point in time as measured by a clock
Information about a file's type and permissions.
The value type used by directory iterators.
Proxy returned by post-increment on directory iterators.
Iterator type for traversing the entries in a single directory.
Iterator type for recursively traversing a directory hierarchy.