• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Code design question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Prev by Date: Re: Mutable class problems
  • Next by Date: Re: Mutable class problems
  • Previous by thread: Re: Where can I find a list with ALL available attributes which can be used with (NSString's) drawInRect: withAttributes
  • Next by thread: NSView and rectangle management
  • Index(es):
    • Date
    • Thread