• 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: Reading a legacy file format
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading a legacy file format


  • Subject: Re: Reading a legacy file format
  • From: Scott Anguish <email@hidden>
  • Date: Mon, 7 Apr 2003 21:49:44 -0400

On Monday, April 7, 2003, at 09:28 PM, David Sinclair wrote:

Another issue is how to convert Pascal strings to NSStrings; there doesn't seem to be a method to do that directly. Is there some C function like ptoc or similar that will do the Pascal to C conversion, then use NSString's stringWithCString, or should I roll my own? Or read the length byte and use stringWithCString:length:?

Actually, there is more or less

CFStringCreateWithPascalString Creates an immutable CFString object from a Pascal string.

This'll give you a CFString which you can than cast to an NSString

<http://developer.apple.com/techpubs/macosx/CoreFoundation/Reference/ CFStringRef/Reference/function_group_1.html#//apple_ref/c/func/ CFStringCreateWithPascalString>
_______________________________________________
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.
  • Follow-Ups:
    • Re: Reading a legacy file format
      • From: David Sinclair <email@hidden>
References: 
 >Reading a legacy file format (From: David Sinclair <email@hidden>)

  • Prev by Date: Reading a legacy file format
  • Next by Date: NSData to long
  • Previous by thread: Reading a legacy file format
  • Next by thread: Re: Reading a legacy file format
  • Index(es):
    • Date
    • Thread