• 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: Convenience method, function for converting 4CCs to strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Convenience method, function for converting 4CCs to strings


  • Subject: Re: Convenience method, function for converting 4CCs to strings
  • From: Chris Adamson <email@hidden>
  • Date: Thu, 28 May 2009 15:48:39 -0400

Oops, sorry, the method and function in my previous version take string params (from a text field in a test app), which isn't generally-useful.  Here are general-purpose versions that take UInt32.

CFStringRef createCFStringFor4CC (UInt32 errorCode) {
errorCode = CFSwapInt32HostToBig (errorCode);
return CFStringCreateWithFormat (
kCFAllocatorDefault, NULL,
(CFStringRef) @"%4.4s", (char*)&errorCode);
}

- (NSString*) stringFor4CC: (UInt32) errorCode {
errorCode = CFSwapInt32HostToBig (errorCode); 
return [NSString stringWithFormat: @"%4.4s", (char*)&errorCode];
}

--Chris
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Convenience method, function for converting 4CCs to strings (From: Chris Adamson <email@hidden>)

  • Prev by Date: Convenience method, function for converting 4CCs to strings
  • Next by Date: Re: Convenience method, function for converting 4CCs to strings
  • Previous by thread: Convenience method, function for converting 4CCs to strings
  • Next by thread: Re: Convenience method, function for converting 4CCs to strings
  • Index(es):
    • Date
    • Thread