std::filesystem::begin(recursive_directory_iterator),std::filesystem::end(recursive_directory_iterator) (3) - Linux Manuals
std::filesystem::begin(recursive_directory_iterator),std::filesystem::end(recursive_directory_iterator): std::filesystem::begin(recursive_directory_iterator),std::filesystem::end(recursive_directory_iterator)
Command to display std::filesystem::begin(recursive_directory_iterator),std::filesystem::end(recursive_directory_iterator)
manual in Linux: $ man 3 std::filesystem::begin(recursive_directory_iterator),std::filesystem::end(recursive_directory_iterator)
NAME
std::filesystem::begin(recursive_directory_iterator),std::filesystem::end(recursive_directory_iterator) - std::filesystem::begin(recursive_directory_iterator),std::filesystem::end(recursive_directory_iterator)
Synopsis
recursive_directory_iterator begin( recursive_directory_iterator iter ) noexcept; (1) (since C++17)
recursive_directory_iterator end( const recursive_directory_iterator& ) noexcept; (2) (since C++17)
1) Returns iter unchanged
2) Returns a default-constructed recursive_directory_iterator, which serves as the end iterator. The argument is ignored.
These non-member functions enable the use of recursive_directory_iterators with range-based for loops.
Parameters
iter - a recursive_directory_iterator
Return value
1) iter unchanged
2) End iterator (default-constructed recursive_directory_iterator)
Example
// Run this code
#include <fstream>
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;
int main()
{
fs::create_directories("sandbox/a/b");
std::ofstream("sandbox/file1.txt");
fs::create_symlink("a", "sandbox/syma");
for(auto& p: fs::recursive_directory_iterator("sandbox"))
std::cout << p << '\n';
fs::remove_all("sandbox");
}
Possible output:
"sandbox/a"
"sandbox/a/b"
"sandbox/file1.txt"
"sandbox/syma"
See also
range-based for loop support
begin(std::filesystem::directory_iterator) (function)
end(std::filesystem::directory_iterator)
Pages related to std::filesystem::begin(recursive_directory_iterator),std::filesystem::end(recursive_directory_iterator)
- std::filesystem::begin(recursive_directory_iterator), (3) - std::filesystem::begin(recursive_directory_iterator),
- std::filesystem::begin(directory_iterator),std::filesystem::end(directory_iterator) (3) - std::filesystem::begin(directory_iterator),std::filesystem::end(directory_iterator)
- std::filesystem::absolute (3) - std::filesystem::absolute
- std::filesystem::canonical,std::filesystem::weakly_canonical (3) - std::filesystem::canonical,std::filesystem::weakly_canonical
- std::filesystem::copy (3) - std::filesystem::copy
- std::filesystem::copy_file (3) - std::filesystem::copy_file
- std::filesystem::copy_options (3) - std::filesystem::copy_options
- std::filesystem::copy_symlink (3) - std::filesystem::copy_symlink
- std::filesystem::create_directory,std::filesystem::create_directories (3) - std::filesystem::create_directory,std::filesystem::create_directories
- std::filesystem::create_hard_link (3) - std::filesystem::create_hard_link
- std::filesystem::create_symlink,std::filesystem::create_directory_symlink (3) - std::filesystem::create_symlink,std::filesystem::create_directory_symlink
- std::filesystem::current_path (3) - std::filesystem::current_path
- std::filesystem::directory_entry (3) - std::filesystem::directory_entry
- std::filesystem::directory_entry::assign (3) - std::filesystem::directory_entry::assign
- std::filesystem::directory_entry::directory_entry (3) - std::filesystem::directory_entry::directory_entry
- std::filesystem::directory_entry::exists (3) - std::filesystem::directory_entry::exists
- std::filesystem::directory_entry::file_size (3) - std::filesystem::directory_entry::file_size
- std::filesystem::directory_entry::hard_link_count (3) - std::filesystem::directory_entry::hard_link_count
- std::filesystem::directory_entry::is_block_file (3) - std::filesystem::directory_entry::is_block_file
- std::filesystem::directory_entry::is_character_file (3) - std::filesystem::directory_entry::is_character_file
- std::filesystem::directory_entry::is_directory (3) - std::filesystem::directory_entry::is_directory