Add fallback implementation of glob for platforms without it. (#660)
Implement a basic glob routine, supporting a subset of POSIX behaviour (e.g. no character classes), as a fallback for platforms such as Android which do not include it in their libc. * Add CMake configuration option `ARB_USE_POSIX_GLOB`, defaults to `ON`, that determines if the fallback implementation is used or not. * Extend `sup::path` functionality to add directory iterators and a couple more path manipulation routines, again following the C++17 `std::filesystem` interface. * Add an NFA pattern matcher `glob_basic_match` and file system `glob_basic` function; the latter is abstracted over a file system provider object, primarily for testing/mocking purposes. * Add unit tests for new `sup::path` functionality and for `glob_basic`. FIxes #181.
Showing
- CMakeLists.txt 6 additions, 0 deletionsCMakeLists.txt
- sup/CMakeLists.txt 8 additions, 1 deletionsup/CMakeLists.txt
- sup/glob_basic.cpp 247 additions, 0 deletionssup/glob_basic.cpp
- sup/glob_basic_wrap.cpp 13 additions, 0 deletionssup/glob_basic_wrap.cpp
- sup/glob_posix.cpp 0 additions, 0 deletionssup/glob_posix.cpp
- sup/include/sup/glob.hpp 89 additions, 2 deletionssup/include/sup/glob.hpp
- sup/include/sup/path.hpp 269 additions, 28 deletionssup/include/sup/path.hpp
- sup/path.cpp 111 additions, 5 deletionssup/path.cpp
- test/unit/CMakeLists.txt 1 addition, 0 deletionstest/unit/CMakeLists.txt
- test/unit/test_glob_basic.cpp 225 additions, 0 deletionstest/unit/test_glob_basic.cpp
- test/unit/test_path.cpp 98 additions, 0 deletionstest/unit/test_path.cpp
Please register or sign in to comment