I am trying to retrieve the files and directories in Qt using the QDir Filter. Based on the user input from the command line I plan to set the appropriate filters and retrieve the corresponding files.
User Input Eg: ./Retrieve -d C:/Sample -h
would retrieve me all the files including hidden files in the directory C:/Sample. I plan to give a host of other options like
-h (for hidden files)
-r (for readonly files)
-s (for system files)
currently my code is something like
QDir::entryList(QDir::Dirs |QDir::NoDotAndDotDot | QDir::Hidden)
If I want to fetch even the system files I need to add just the Qdir::system filter
.
How can I append this to the existing filters I would have already mentioned.
My question is How do I add these filters to the QDir function entry List by having simple online code but build up the filters by looking at the user input?