Skip to content

peelonet/peelo-glob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

peelo-glob

Build

C++17 header only wrapper to glob() function.

Does not work on Windows.

Example

#include <peelo/glob.hpp>
#include <iostream>

int
main(int argc, char** argv)
{
  std::vector<std::filesystem::path> results;

  // The functions returns `true` if the globbing was successful, `false`
  // otherwise.
  if (peelo::glob("*.cpp", results))
  {
    // The vector given as argument now contains `std::filesystem::path`
    // objects that are matches of the glob.
    for (const auto& path : results)
    {
      std::cout << path << std::endl;
    }
  }

  return 0;
}