Reputation: 979
I would like to write a program that index file names and its content in a given directory. If they match a given regular expression, then I would like to index them. I will use regex functions.
I don't really know how to start this.
I would use a polymorphic approach:
I am also thinking about using map to build trees.
May you tell me your opinion about this please?
Upvotes: 0
Views: 132
Reputation: 27528
For filesystem functionality, use Boost.Filesystem.
For regular expressions, use <regex>
for C++11, Boost.Regex otherwise.
Any initial(!) trouble you might have when installing and learning Boost will very quickly pay off.
For your map, use std::map
.
In any case, do not reinvent the wheel.
Upvotes: 2