Namespaces | |
namespace | CP_FileSystem |
Files and Folders | |
void | DeleteObject (const CP_FileSystemSpec &inOutFileSpec, bool inNotifyFinder=true) |
bool | SetLocked (const CP_FileSystemSpec &inFileSpec, bool inLockit) |
bool | SetReadOnly (const CP_FileSystemSpec &inFileSpec, bool inReadOnly) |
Files | |
void | DeleteFile (const CP_FileSystemSpec &inOutFileSpec, bool inNotifyFinder=true) |
void | RenameFile (const CP_FileSystemSpec &inFileSpec, const CP_String &inNewName, CP_FileSystemSpec *outRenamedFileSpec, bool inNotifyFinder=true) |
void | RenameFile (CP_FileSystemSpec &inOutFileSpec, const CP_String &inNewName, bool inNotifyFinder=true) |
CP_String | GetExtension (const CP_FileSystemSpec &inFileSpec) |
CP_FileSystemSpec | SetExtension (const CP_FileSystemSpec &inFileSpec, const CP_String &inFileExtension) |
bool | HasExtension (const CP_FileSystemSpec &inFileSpec, const CP_String &inFileExtension) |
SInt64 | GetSize (const CP_FileSystemSpec &inFileSpec) |
FourCharCode | GetType (const CP_FileSystemSpec &inFileSpec) |
void | GetTypeAndCreator (const CP_FileSystemSpec &inFileSpec, FourCharCode *outType, FourCharCode *outCreator) |
CP_Date | GetCreatedDate (const CP_FileSystemSpec &inFileSpec) |
CP_Time | GetCreatedTime (const CP_FileSystemSpec &inFileSpec) |
CP_Date | GetModifiedDate (const CP_FileSystemSpec &inFileSpec) |
CP_Time | GetModifiedTime (const CP_FileSystemSpec &inFileSpec) |
CP_OSIcon | GetLargeIcon (const CP_FileSystemSpec &inFileSpec) |
CP_OSIcon | GetSmallIcon (const CP_FileSystemSpec &inFileSpec) |
CP_FileSystemSpec | CreateTempFile (const CP_String &inFileNameTemplate=CP_String::emptyString, const CP_FileSystemSpec *inParentFolder=NULL) |
Creates a unique temporary file. | |
Folders | |
CP_FileSystemSpec | CreateFolder (const CP_FileSystemSpec &inParentFolderSpec, const CP_String inFolderName, bool inNotifyFinder=true) |
CP_FileSystemSpec | CreateFolder (const CP_FileSystemSpec &inFolderSpec, bool inNotifyFinder=true) |
void | RemoveFolder (const CP_FileSystemSpec &inOutFileSpec, bool inNotifyFinder=true) |
bool | FolderExists (const CP_FileSystemSpec &inFolderSpec) |
CP_FileSystemSpec | GetFolder (FourCharCode inFolderType, const OSVolume &inVolume=kOnSystemDisk) |
CP_FileSystemSpec | GetTempFolder (const OSVolume &inVolume=kOnSystemDisk) |
CP_FileSystemSpec | GetTempFileSpec (const CP_String &inFileName, const CP_String &inFileExtension) |
CP_FileSystemSpec | CreateTempFolder (const CP_String &inFolderNameTemplate=CP_String::emptyString) |
Creates a unique temporary file. | |
Volumes | |
bool | VolumeExists (const CP_String &inVolumeName) |
Testers | |
bool | IsWriteable (const CP_FileSystemSpec &inFileSpec) |
bool | ExistsOnDisk (const CP_FileSystemSpec &inFileSpec) |
Testers | |
bool | HasResourceFork (const CP_FileSystemSpec &inFileSpec) |
Creator and Type | |
FourCharCode | GetCreator (const CP_FileSystemSpec &inFileSpec) |
void | SetCreatorAndType (const CP_FileSystemSpec &inFileSpec, FourCharCode inCreator, FourCharCode inType) |
void | SetCreator (const CP_FileSystemSpec &inFileSpec, FourCharCode inCreator) |
void | SetType (const CP_FileSystemSpec &inFileSpec, FourCharCode inType) |
File Info | |
CP_OSIcon | GetOSLargeIcon (const CP_FileSystemSpec &inFileSpec) |
CP_OSIcon | GetOSSmallIcon (const CP_FileSystemSpec &inFileSpec) |
CP_OSIcon | GetIconServicesIcon (const CP_FileSystemSpec &inFileSpec) |
File operation | |
bool | RecursiveDeleteDirectory (const CP_String &inDirectory) |
Functions | |
OSStatus | FSMakeFSRefUnicodeLinkSafe (const FSRef *parentRef, UniCharCount nameLength, const UniChar *name, TextEncoding textEncodingHint, FSRef *newRef) throw () |
Make an FSRef and be smart about parentRef pointing to symlink. | |
OSStatus | FollowSymlink (const FSRef &inFileRef, FSRef *outResolvedFileRef, bool *outWasSymlink=NULL, bool *outIsFolder=NULL) throw () |
Resolve a potential symlink. | |
Variables | |
CPLAT_Begin_Namespace_CPLAT const OSVolume | kOnSystemDisk = "c" |
|
Deletes the platforms file system file or folder with the passed in file spec. This throw an OSError exception on any errors, such as the file not existing in the platforms file system. Before calling this routine you need to make sure that the file is not currently in use or open, as this will cause an error to be thrown. This will also reset the contents of the passed in inFileSpec to reflect the fact that the file no longer exists in the file system.
|
|
Locks or unlocks a file or folder.*
|
|
Set the file read only or not.
|
|
Deletes the platforms file system file with the passed in file spec. This throw an OSError exception on any errors, such as the file not existing in the platforms file system. Before calling this routine you need to make sure that the file is not currently in use or open, as this will cause an error to be thrown. This will also reset the contents of the passed in inFileSpec to reflect the fact that the file no longer exists in the file system.
|
|
Changes the name for the file system object specified by the passed in file spec.
|
|
Changes the name for the file system object specified by the passed in file spec. The file system specifier will be updated to reflect the new name after the object has been renamed on disk.
|
|
Returns the extension for the passed in file.
|
|
Sets the extension for the passed in file spec. This will first check to see if the file has the existing extension, and if so not set it.
|
|
Tests the passed in file spec to see if the file it points to has the passed in file extension.
|
|
Returns the size of the file system object represented by the passed in CP_FileSystemSpec.
|
|
Returns the type code specified by the passed in file spec. For non MacOS builds, this will be the same as the files extension, up to 4 characters.
|
|
Returns the type and creator code specified by the passed in file spec. For non MacOS builds the type will be the same as the files extension, up to 4 characters. For non MacOS builds the creator will be kCP_Unknown_FileType
|
|
Returns the date the file represented by the passed in CP_FileSystemSpec was created. The result is returned as a CP_Date object.
|
|
Returns the time the file represented by the passed in CP_FileSystemSpec was created. The result is returned as a CP_Time object.
|
|
Returns the last date the file represented by the passed in CP_FileSystemSpec was modified. The result is returned as a CP_Date object.
|
|
Returns the last time the file represented by the passed in CP_FileSystemSpec was modified. The result is returned as a CP_Time object.
|
|
Returns a CP_OSIcon object that represents the large icons used by the OS for the file represented by the passed in CP_FileSystemSpec.
|
|
Returns a CP_OSIcon object that represents the small icons used by the OS for the file represented by the passed in CP_FileSystemSpec.
|
|
Creates a unique temporary file on disk. The file is located in a temporary directory and has a unique name, which is guaranteed to not exist. The filename is characterized by the filename template passed: any trailing 'X' in the filename (excl. the extension) will be replaced with unique alphanumeric digits. The more 'X's in the filename, the larger the space of potential unique names.
|
|
Creates a folder in the passed in parent directory with the name as specified in inFolderName. If the folder already exists, then the CP_FileSystemSpec returned points to the existing folder. Otherwise the returned CP_FileSystemSpec will point to the newly created folder.
|
|
Creates a folder at the location specified by inFolderSpec. If the folder already exists, then the CP_FileSystemSpec returned points to the existing folder. Otherwise the returned CP_FileSystemSpec will point to the newly created folder.
|
|
Removes the folder or directory represented by the passed in CP_FileSystemSpec. Returns CP_noErr if successful.
|
|
Returns true if the folder or directory represented by the passed in CP_FileSystemSpec object exists in the current file system.
|
|
Returns a CP_FileSystemSpec object to a specific platforms folder. If the platform doesn't have the named folder, then the applications folder is returned.
|
|
Returns a CP_FileSystemSpec object to a platforms temporary folder. If the platform doesn't have a temporary folder, then the applications folder is returned.
|
|
Returns a CP_FileSystemSpec object to a temporary file location in the platforms temporary folder. If the platform does not have a native temporary folder, then the file is created in the same folder as the application.
|
|
Creates a unique temporary folder on disk. The folder is located in a temporary directory and has a unique name, which is guaranteed to not exist. The foldername is characterized by the foldername template passed: any trailing 'X' in the foldername will be replaced with unique alphanumeric digits. The more 'X's in the foldername template, the larger the space of potential unique names.
|
|
Returns true if the volume specified by the passed in name exists in the platforms native file system.
|
|
Returns true if the file specified by the passed in file spec is able to be written to.
|
|
Returns true if the object specified by the passed in file spec exists in the platforms native file system and it is a file.
|
|
Returns true if the file specified by the passed in file spec has a resource fork.
|
|
Returns the creator code for the file system object represented by the passed in CP_FileSystemSpec. This can be either a file or folder.
|
|
Sets the files creator and type codes specified by the passed in file spec.
|
|
Set the files creator code specified by the passed in file spec.
|
|
Sets the files type code specified by the passed in file spec.
|
|
Same as FSMakeFSRefUnicode, except when parentRef points to a symlink, the function won't fail with errFSNotAFolder, but will resolve the parent link instead.
|
|
(comprehensive description)
|
|
Returns a CP_OSIcon object that represents the large icons used by the OS for the file represented by the passed in CP_FileSystemSpec. This is the version used by the MacOS to retrieve the icon.
|
|
Returns a CP_OSIcon object that represents the small icons used by the OS for the file represented by the passed in CP_FileSystemSpec. This is the version used by the MacOS to retrieve the icon.
|
|
Common routine used by the MacOS version of GetOSLargeIcon and GetOSSmallIcon to return a CP_OSIcon object for the represented file using the MacOS Icon Services.
|
|
|
|
|