SceneGate / Yarhl

Framework for the implementation of format converters like game assets or media files
https://scenegate.github.io/Yarhl/
MIT License
60 stars 10 forks source link

Advanced filter in FromDirectory #166

Closed Kaplas80 closed 3 years ago

Kaplas80 commented 3 years ago

Description

This PR allows using a Func to define the filter in NodeFactory.FromDirectory methods.

This way, the users can define more precisely the files to add to the container.

On the other side, this method will be slower than wildcard filters because it first enumerates all files and, later, filters them.

Example

Get files using a regular expression:

Node node = NodeFactory.FromDirectory(tempDir, x => Regex.IsMatch(x, @"file\d\.(txt|bin)$"));