Re: NSHFSTypeCodeFromFileType troubles
Re: NSHFSTypeCodeFromFileType troubles
- Subject: Re: NSHFSTypeCodeFromFileType troubles
- From: "David W. Halliday" <email@hidden>
- Date: Thu, 07 Mar 2002 16:31:52 -0600
Ali Ozer wrote:
>
These functions are not meant for converting type codes back and forth
>
from string representations, so you might be misusing them.
>
>
NSFileTypeForHFSTypeCode() is used to create NSStrings from Mac OS type
>
codes; NSStrings which can be passed to Cocoa APIs that expect file
>
extensions, to get them to also recognize Mac OS type codes.
>
NSHFSTypeCodeFromFileType() does the reverse; assuming you pass it an
>
NSString created with NSHFSFileTypeFromTypeCode(), it returns the type
>
code that was used.
>
>
The fact that the string representation that is used has single-quotes
>
is supposed to be an implementation detail. Unfortunately one that would
>
be hard to change, but an implementation detail nevertheless...
Actually, even the "fact" that the NSStrings that are used by the Cocoa APIs are
"file extensions" (without the period) is an /implementation detail/ that should not
be relied upon by Cocoa developers! ;-) As one can ascertain from the API, they are
/intended/ to be an abstract representation of the type of files and pasteboard
(clipboard) contents. (Of course, this is not to say that the API may not have some
holes where this abstract type gets too closely equated to "file extension". This
is something that would need to be /cleaned up/ in order to break with this
/implementation detail/.)
>
Ali
>
>
On Thursday, March 7, 2002, at 12:13 PM, Chris Gervais wrote:
>
>
> Ah...I didn't even think to include the single quote as I thought that
>
> NSHFSTypeCodeFromFileType just took the string as it was...the doc
>
> needs to
>
> be more clear on this!
>
>
>
>> ...
email@hidden
_______________________________________________
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.