Code design question
Code design question
- Subject: Code design question
- From: kubernan <email@hidden>
- Date: Tue, 25 Jun 2002 11:18:38 +0200
Hello,
I need your help in a code design problem, hoping it will be clear
enough :
I'm building a file searching app. (in cocoa of course)
offering multiple criterion options.
For example (in comprehensive language) :
search all files [that contain "foo" in the file name] OR [created today
and where file name extension [contains "jpg"] or [contains "png"]]
As you can see, we have in fact two main queries (separated with OR).
The first query looks for the file name only.
The second one looks for the file name (extension) and the creation date.
I didn't find an nice solution to make a such a query in my program
knowing that each query can have variable length (only one criterion
for example in the first sub-query ("foo"), or two criterions
for example in the second sub query (based on creation date and
the file name extension)).
I think i can build in my program a list of identified sub-queries, then
i build
atomic search ("fileExistsAtPath...") for each :
1 - One for files named with "foo"
2 - One for files created today
3 - One for files ending by jpg
4 - 0ne for files ending by png
Then i have to merge the search result of query #3-2 merge 4-2 for the
second criterion (after the first OR).
Any other idea ?
Thx for your help.
K.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.