By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,199 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

Using C++ To Search Directory

P: 6
hi im currently using C++ for a project and was wondering if anyone could help me out with a problem i have encountered

basically i was wanting to search through a set number of files in a directory for certain tags or comments. after that i was hoping to search through all the files again that contained tags to find out if there was more than one tag in each file and display those files or tags in a list

thanks in advance for your help if you do so
Mar 23 '07 #1
Share this Question
Share on Google+
3 Replies


sicarie
Expert Mod 2.5K+
P: 4,677
hi im currently using C++ for a project and was wondering if anyone could help me out with a problem i have encountered

basically i was wanting to search through a set number of files in a directory for certain tags or comments. after that i was hoping to search through all the files again that contained tags to find out if there was more than one tag in each file and display those files or tags in a list

thanks in advance for your help if you do so
What OS are you using?
How are the tags stored (as files? file attributes?)
What about comments?
What have you tried so far?
Mar 23 '07 #2

P: 6
What OS are you using?
How are the tags stored (as files? file attributes?)
What about comments?
What have you tried so far?
The operating system i am using is WinXP Pro SP2

The tags are stored as comments within files. With the text "TODO" used as
our tag marker to show it is a tag. Once a tag has been found we wish to read the text after the "TODO" tag and put all the information after the "TODO" into a class.

So far we have tried to search through the the program itself for all information after the "TODO" tag and stored all the information into a string and printed all the text on the output screen.

thanks very much for your help
Mar 29 '07 #3

sicarie
Expert Mod 2.5K+
P: 4,677
The operating system i am using is WinXP Pro SP2

The tags are stored as comments within files. With the text "TODO" used as
our tag marker to show it is a tag. Once a tag has been found we wish to read the text after the "TODO" tag and put all the information after the "TODO" into a class.

So far we have tried to search through the the program itself for all information after the "TODO" tag and stored all the information into a string and printed all the text on the output screen.

thanks very much for your help
The 'TODO' starts the comment, but is there a definite end delimiter? As is, I believe you're going to need to use fstreams, getline, and strtok to find the 'TODO' tag.
Mar 30 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.