• 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
Re: How to convert from an OSString to an OSNumber ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to convert from an OSString to an OSNumber ?


  • Subject: Re: How to convert from an OSString to an OSNumber ?
  • From: Dean Reece <email@hidden>
  • Date: Fri, 1 Apr 2005 14:48:11 -0800

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.

Cheers,
 - Dean

On Apr 1, 2005, at 2:39 PM, Godfrey van der Linden wrote:
No OSDynamicCast doesn't do anything at all like this.

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.

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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >How to convert from an OSString to an OSNumber ? (From: "Brian Jorgage" <email@hidden>)
 >Re: How to convert from an OSString to an OSNumber ? (From: Godfrey van der Linden <email@hidden>)

  • Prev by Date: Re: How to convert from an OSString to an OSNumber ?
  • Next by Date: dlil_attah_interface_filter
  • Previous by thread: Re: How to convert from an OSString to an OSNumber ?
  • Next by thread: dlil_attah_interface_filter
  • Index(es):
    • Date
    • Thread