IDEA 10.5 Командная строка слишком длинная

C ++ 17 теперь имеет std::filesystem::directory_iterator , который может использоваться как

#include 
#include 
#include 
namespace fs = std::filesystem;

int main()
{
    std::string path = "/path/to/directory";
    for (const auto & p : fs::directory_iterator(path))
        std::cout << p << std::endl; // "p" is the directory entry. Get the path with "p.path()".
}

. Кроме того, std::filesystem::recursive_directory_iterator может выполнять итерацию в подкаталогах.

24
задан qinmiao 17 June 2011 в 04:04
поделиться