Introduce p-ranav/glob library for file globbing #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the p-ranav/glob library to replace using OS-specific glob methods, and replaces all of the Windows-API-based code in files.windows.cc with normal
filesystem
methods to do the same thing. The code between Windows and POSIX could potentially be combined into a single file, since they are very close to each other at this point.There is one additional TODO I added at the error case in
FilesLinesWindows::snapshot
. First off, this error case probably isn't being hit by the tests. The table requires four columns but we're only inserting three here (we're missing thepattern
column). I only discovered this because we fall into thisif
block when we hit thesub
directory added to the test when it can't be opened byifstream
. I added a check for directories to get around it temporarily.