• 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
Make a version of NSData "rangeOfData: options: range:" for multiple search parameters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Make a version of NSData "rangeOfData: options: range:" for multiple search parameters


  • Subject: Make a version of NSData "rangeOfData: options: range:" for multiple search parameters
  • From: Daryle Walker <email@hidden>
  • Date: Fri, 15 Apr 2016 00:33:51 -0400

I need a version of the method listed in the subject that works on multiple search strings instead of one, stopping at the first & longest match.  Any ideas?

I already posted this on StackOverflow at <http://stackoverflow.com/questions/36558304/how-to-do-multiple-searches-within-a-nsdata-object>. There has already been work done on finding over the decades, both with a single search string or a set of them, each using different algorithms. I hope it isn’t too hard to adapt one of the search string set algorithms.  Of course, instead of stalling my project, I could just search separately for CR and LF for now and consolidate the results.  (And come back to a proper solution later.)

Now i think it may be better to make use a custom Swift generator type (or a cross-language Objective-C/Swift enumerator class) to do this function, instead of a single method call.  Setting up the parse table for multiple search string may take a lot of work, which is thrown away for single method calls, unless NSData starts secretly cacheing search string sets and their parse tries.

—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Make a version of NSData "rangeOfData: options: range:" for multiple search parameters
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: NSDocument saving query (SOLVED)
  • Next by Date: CFBridgingRetain does not leak memory
  • Previous by thread: Re: NSDocument saving query (SOLVED)
  • Next by thread: Re: Make a version of NSData "rangeOfData: options: range:" for multiple search parameters
  • Index(es):
    • Date
    • Thread