On Jan 7, 2004, at 11:59 AM, John Levon wrote:
All of the code changes are inside QT_WS_MAC defines.
Looks fine
+ UInt8 buf[255];
+ CFURLGetFileSystemRepresentation(FontsURL, true, buf, 255);
But is this definitely correct ? (i.e. is the function API including null termination or not ?
From Apple's Developer Connection (where the documentation often is wrong!):
CFURLGetFileSystemRepresentation
Fills a buffer with the file system's native string representation of URL's path.
Boolean CFURLGetFileSystemRepresentation (
CFURLRef url,
Boolean resolveAgainstBase,
UInt8 *buffer,
CFIndex maxBufLen
);
Parameter Descriptions
url
The CFURL object whose native file system representation you wish to obtain.
resolveAgainstBase Pass true if you wish an absolute path name to be returned.
buffer
A pointer to a character buffer. On return, the buffer holds the native file system's representation of url. The buffer is null-terminated. This parameter should be at least maxBufLen in size for the file system in question to avoid failures for insufficiently large buffers.
maxBufLen The maximum number of characters that can be written to buffer.
function result true if successful, false if an error occurred.
Discussion
No more than maxBufLen bytes are written to buffer. If url requires more than maxBufLen bytes to represent itself, including the terminating null byte. this function returns false. To avoid this possible failure, you should pass a buffer of size MAX_PATH_LEN.
--
Ronald