views:

72

answers:

1

hello, i've just started learning winapis and c++ programming ..

i was thinking about starting a personal project (to enhance my coding, and to help me understand the winapis better)..

and i've decided to program a "cmd" files renamer, that basically takes :

1)a path

2)a keyword

3)the desiered formate

4)versioned or not (or numbered, like if u had 20 episodes of the same show, u wouldnt wanna truncate the episode number)..

5)special cases to delete (like when ur downloading a torrent, they have a [309u394] attached to the name.. and most of the time an initial [WE-RIP-TV-SHOWS-HDTV-FANSUBS-GROUPS-ETC]

i am building the logic as follows:

the program takes the path(input 1),

performs a full files indexing.. then it compares the files found against the keyword example gives (input 2) (use regex?)

Reformat file name step. (input 3, 4, 5);

save file name.

questions:

A) is my logic flow proper? any suggestions to improve it?

B)should i use Regex to check against file name, keyword, and desired format? (not good with regex yet) , i mean is it the best way to perform the huge amount of comparisons ?

+1  A: 

Regular expressions should do the trick. Also you could use the Boost library, it has some really neat functions including the regexp, which is probably faster than the functions you'll find around (:

Ahmed
:)already using the boost library :Dand thx.i am still pretty new to regular exp.
Madi D.
You're welcome (:
Ahmed