Re: How to convert from an OSString to an OSNumber ?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Cheers, - Dean No OSDynamicCast doesn't do anything at all like this. I'd suggest looking at the docs of OSNumber construction. Godfrey On Apr 1, , at 14:29, Brian Jorgage wrote: I am passing in a sequence of numbers as an OSString. I am able to parse out the five fields based on a delimiter character. So now I have five strings that are actually representing numeric data. I am trying to convert the strings into OSNumbers but without success. OSDynamicCast() does not seem to allow operations of type: OSDynamicCast(OSNumber, OSString) or OSDynamicCast(OSNumber, OSString->getCStringNoCopy()) Can anyone provide me w/some help in this ? _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... Or, if all you want to is get 5 ints, then just use sscanf() on your original string (using getCStringNoCopy) to grab all 5 ints in a single operation. sscanf(), as well as strtol() and friends are available in com.apple.kernel.libkern and com.apple.kpi.libkern. On Apr 1, 2005, at 2:39 PM, Godfrey van der Linden wrote: It's intent is for you to get a OSObject * pointer and work out what class it is. It will not do conversion only validation. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/ dean.reece%40apple.com This email sent to dean.reece@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Dean Reece