GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::experimental::filesystem::recursive_directory_iterator::disable_recursion_pending(3) C++ Standard Libary std::experimental::filesystem::recursive_directory_iterator::disable_recursion_pending(3)

std::experimental::filesystem::recursive_directory_iterator::disable_recursion_pending - std::experimental::filesystem::recursive_directory_iterator::disable_recursion_pending


void disable_recursion_pending(); (filesystem TS)


Disables recursion to the currently referred subdirectory, if any.


The call modifies the pending recursion flag on the iterator in such a way that the
next time increment is called, the iterator will advance within the current directly
even if it is currently referring to a subdirectory that hasn't been visited.


The status of the pending recursion flag can be queried with recursion_pending(),
which is false after this call. It is reset back to true after increment, and its
initial value is also true.


The behavior is undefined if *this is the end iterator.


(none)


(none)


May throw implementation-defined exceptions.

// Run this code


#include <fstream>
#include <iostream>
#include <string>
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;


int main()
{
fs::create_directories("sandbox/a/b/c");
fs::create_directories("sandbox/a/b/d/e");
std::ofstream("sandbox/a/b/file1.txt");
fs::create_symlink("a", "sandbox/syma");
for(auto i = fs::recursive_directory_iterator("sandbox");
i != fs::recursive_directory_iterator();
++i ) {
std::cout << std::string(i.depth(), ' ') << *i;
if(fs::is_symlink(i->symlink_status()))
std::cout << " -> " << fs::read_symlink(*i);
std::cout << '\n';


// do not descend into "b"
if(i->path().filename() == "b")
i.disable_recursion_pending();
}
fs::remove_all("sandbox");
}


"sandbox/a"
"sandbox/a/b"
"sandbox/syma" -> "a"


recursion_pending checks whether the recursion is disabled for the current directory
(public member function)
increment advances to the next entry
operator++ (public member function)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.