Make a version of NSData "rangeOfData: options: range:" for multiple search parameters
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