I'm trying to implement glob(3)
, or glob
-alike function in C++.
I already have a function that reads directory contents into an std::vector<std::string>
container (let's call this function ListDirectory()
), so I'd obviously only need the stringmatching part - My questions:
- What kind of concept should one follow when implementing it?
- Are there common gotchas one should keep in mind?
- Is it wise to use a fullblown regexp library (like PCRE), or rather simple pattern matching a la Lua?
- If using simple pattern matching is better, are there already working functions/libraries/classes available (what about
scanf
and friends)?