Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_FileSystemSpec_Imp Class Reference

MacOS implementation of the CP_FileSystemSpec_Imp class. More...

Inheritance diagram for CP_FileSystemSpec_Imp:

CP_FileSystemSpec List of all members.

Public Member Functions

virtual ~CP_FileSystemSpec_Imp ()
void GetParent (FSRef &inOutParentRef) const
FSRefResult GetParent () const
void GetName (HFSUniStr255 &inOutName) const
CP_String GetName () const
FSRefResult GetFSRef () const
FSSpec GetFSSpec () const
OSVolume GetVolume () const
SInt16 GetVolumeID () const
SInt32 GetParID () const
CP_CFURL GetAsCFURL ()
CP_String GetFullPath_Posix () const
CP_String GetFullPath_HFS () const
bool operator== (const CP_FileSystemSpec_Imp &inFileSpec)
bool operator!= (const CP_FileSystemSpec_Imp &inFileSpec)
void Set (FSRef inFileRef)
void Set (const CP_String &inName, FSRef inParentRef)
void Set (const FSSpec &inFSSpec, CFStringEncoding inEncoding=::CFStringGetSystemEncoding())
void Set (SInt16 vRefNum, SInt32 dirID)
void Set (const CP_String &inFullpath)
void SetName (const CP_String &inFileName)
bool IsValid () const
bool ExistsOnDisk () const
bool IsDirectory () const
bool IsEqual (const CP_FileSystemSpec_Imp &) const
void AssertDecomposedForm () const
 Makes sure the filespec is in decomposed form (parentDirRef + name).

Protected Member Functions

 CP_FileSystemSpec_Imp ()
 CP_FileSystemSpec_Imp (const CP_FileSystemSpec_Imp &inFileSpec_Imp)
 CP_FileSystemSpec_Imp (const CP_String &inFullPath)
 CP_FileSystemSpec_Imp (FSRef inFileRef)
 CP_FileSystemSpec_Imp (const FSSpec &inFSSpec, CFStringEncoding inEncoding=::CFStringGetSystemEncoding())
CP_FileSystemSpec_Impoperator= (const CP_FileSystemSpec_Imp &)
FSRef FSSpecToFSRef (const FSSpec &inFSSpec)
FSSpec FSRefToFSSpec (const FSRef &inFSRef)
CP_String GetFullPathInStyle (CFURLPathStyle inPathStyle) const

Protected Attributes

bool fExists
bool fIsValid
FSRef fRef
CP_String fName

Classes

struct  FSRefResult
 Smart FSRef result class. More...

Detailed Description

This class implements the CP_FileSystemSpec for the MacOS platform, and has methods you can call directly, or are called by the framework for MacOS specific features.


Constructor & Destructor Documentation

CP_FileSystemSpec_Imp::~CP_FileSystemSpec_Imp  )  [virtual]
 

Destructor.

CPLAT_Begin_Namespace_CPLAT CP_FileSystemSpec_Imp::CP_FileSystemSpec_Imp  )  [protected]
 

Constructor.

CP_FileSystemSpec_Imp::CP_FileSystemSpec_Imp const CP_FileSystemSpec_Imp inFileSpec_Imp  )  [protected]
 

Copy constructor. Sets the fields of this object from the passed in CP_FileSystemSpec_Imp object.

Parameters:
inFileSpec_Imp File system spec imp class to copy fiels from.

CP_FileSystemSpec_Imp::CP_FileSystemSpec_Imp const CP_String inFullPath  )  [protected]
 

Constructor. Sets the fields of this specification from the passed in string containing the full path of the file or folder.

Parameters:
inFullPath CP_String containing the full path of the file or folder.

CP_FileSystemSpec_Imp::CP_FileSystemSpec_Imp FSRef  inFileRef  )  [protected]
 

CP_FileSystemSpec_Imp::CP_FileSystemSpec_Imp const FSSpec &  inFSSpec,
CFStringEncoding  inEncoding = ::CFStringGetSystemEncoding()
[protected]
 


Member Function Documentation

void CP_FileSystemSpec_Imp::GetParent FSRef &  inOutParentRef  )  const
 

Returns an FSRef to the parent folder of this file system specification.

Parameters:
inOutParentRef FSRef to hold the result.
Returns:
void

CP_FileSystemSpec_Imp::FSRefResult CP_FileSystemSpec_Imp::GetParent  )  const
 

Returns an FSRef to the parent folder of this file system specification.
The FSRef is returned as an FSRefResult, which is a convenience class that can act as both an FSRef and a const FSRef *

Returns:
FSRefResult FSRef to the parent folder.

void CP_FileSystemSpec_Imp::GetName HFSUniStr255 &  inOutName  )  const
 

Returns the name of the file as a HFSUniStr255 in the passed in parameter.

Parameters:
inOutName HFSUniStr255 to hold the result.
Returns:
void const

CP_String CP_FileSystemSpec_Imp::GetName  )  const
 

Return the name of this file system object as a CP_Stringn.

Returns:
CP_String const Returns the name of the file that this spec points to.

CP_FileSystemSpec_Imp::FSRefResult CP_FileSystemSpec_Imp::GetFSRef  )  const
 

Returns a reference to the FSRef for this file or folder. If the object does not exist on disk, or this object is not valid, an OSException is thrown with the errFSBadFSRef code.
The FSRef is returned as an FSRefResult, which is a convenience class that can act as both an FSRef and a const FSRef *

Returns:
FSRefResult Returns an FSRef for the file pointed to by this filesystem spec.

FSSpec CP_FileSystemSpec_Imp::GetFSSpec  )  const
 

Returns a MacOS FSSpec for this file.

Returns:
FSSpec Returns a MacOS FSSpec.

OSVolume CP_FileSystemSpec_Imp::GetVolume  )  const
 

SInt16 CP_FileSystemSpec_Imp::GetVolumeID  )  const
 

Returns the volume id for this file system spec.

none

Returns:
SInt16 const The volume reference number.

SInt32 CP_FileSystemSpec_Imp::GetParID  )  const
 

Returns the par id for this file system spec.

none

Returns:
SInt32 const The par id of this file.

CP_CFURL CP_FileSystemSpec_Imp::GetAsCFURL  ) 
 

CP_String CP_FileSystemSpec_Imp::GetFullPath_Posix  )  const
 

CP_String CP_FileSystemSpec_Imp::GetFullPath_HFS  )  const
 

bool CP_FileSystemSpec_Imp::operator== const CP_FileSystemSpec_Imp inFileSpec_Imp  ) 
 

Inequality operator. Checks if this object is not equal to the passed in CP_FileSystemSpec_Imp object.

Parameters:
inFileSpec_Imp Object to compare against.
Returns:
bool Returns true if the passed in file spec is not equal to this object.

bool CP_FileSystemSpec_Imp::operator!= const CP_FileSystemSpec_Imp inFileSpec  ) 
 

void CP_FileSystemSpec_Imp::Set FSRef  inFileRef  ) 
 

Sets this file system spec to point to the FSRef passed in.

Parameters:
inFileRef FSRef to an existing file system object.
Returns:
void

void CP_FileSystemSpec_Imp::Set const CP_String inFileName,
FSRef  inParentRef
 

Sets this file system spec to point to an object location in the parent folder specified by inParentRef with the file name inFileName. This could point to a non-existant file if it has not been created yet.

Parameters:
inFileName CP_String containing the name of the file or folder.
inParentRef FSRef to the parent folder of this object.
Returns:
void

void CP_FileSystemSpec_Imp::Set const FSSpec &  inFSSpec,
CFStringEncoding  inEncoding = ::CFStringGetSystemEncoding()
 

Sets this file system spec to point to the object specified in the passed inFSSpec. This could point to a non-existant file if it has not been created yet.

Parameters:
inFSSpec FSSpec for the file or folder.
inEncoding String encoding to use for the name.
Returns:
void

void CP_FileSystemSpec_Imp::Set SInt16  vRefNum,
SInt32  dirID
 

Sets this file system spec to point to the object specified in the passed volume reference number, and directory id. This specifies a folder.

Parameters:
vRefNum Volume reference number.
dirID Directory id.
Returns:
void

void CP_FileSystemSpec_Imp::Set const CP_String inFullPath  ) 
 

Sets this file system spec to point to the full path passed in.

Parameters:
inFileRef CP_String represented by the passed in string.
Returns:
void

void CP_FileSystemSpec_Imp::SetName const CP_String inFileName  ) 
 

bool CP_FileSystemSpec_Imp::IsValid  )  const
 

Return true if this points to a valid file specification in the platforms native file system. The file can be valid, but not yet exist in the native file system.

Returns:
bool const True if the file specification is valid.

bool CP_FileSystemSpec_Imp::ExistsOnDisk  )  const
 

Return true if this points to a file that currently exists in the platforms native file system.

Returns:
bool const True if the file exists in the platforms native file system.

bool CP_FileSystemSpec_Imp::IsDirectory  )  const
 

Returns true if this file spec represents a directory.

Exceptions:
OSStatus OSStatus exception. CP_paramErr if this spec does not represent an existing file.
Returns:
bool const True if this file spec represents a directory.

bool CP_FileSystemSpec_Imp::IsEqual const CP_FileSystemSpec_Imp  )  const
 

void CP_FileSystemSpec_Imp::AssertDecomposedForm  )  const
 

Since an FSRef can't point to a non-existing file, file specs for those files must be represented as an FSRef for the parent directory and a string for the node's name.
This functions ensures that the CP_FileSystemSpec in question is represented in that form. This is important to make sure the filespec remains valid after removing a file.

Note:
This function is const, even though it modifies the contents, but since it doesn't change the semantical contents of the object, it's conceptually constant.
Exceptions:
Any OSErr exception may be raised if the filespec is not valid or if the file doesn't exist any more.

CP_FileSystemSpec_Imp & CP_FileSystemSpec_Imp::operator= const CP_FileSystemSpec_Imp inFileSpec_Imp  )  [protected]
 

Assignment operator. Assigns the information for this object from the passed in CP_FileSystemSpec_Imp object.

Parameters:
inFileSpec_Imp Object to copy the information from.
Returns:
CP_FileSystemSpec_Imp& Returns a reference to ourselves.

FSRef CP_FileSystemSpec_Imp::FSSpecToFSRef const FSSpec &  inFSSpec  )  [protected]
 

Returns a FSRef to the file specified in the passed in FSSpec. This throws an OSError exception if not successful.

Parameters:
inFSSpec FSSpec of the object to return FSRef for.
Returns:
FSRef FSRef to the object.

FSSpec CP_FileSystemSpec_Imp::FSRefToFSSpec const FSRef &  inFSRef  )  [protected]
 

Returns a FSSpec to the file specified in the passed in FSRef. This throws an OSError exception if not successful.

Parameters:
inFSRef FSRef of the object to return FSRef for.
Returns:
FSSpec FSSpec to the object.

CP_String CP_FileSystemSpec_Imp::GetFullPathInStyle CFURLPathStyle  inPathStyle  )  const [protected]
 


Member Data Documentation

bool CP_FileSystemSpec_Imp::fExists [protected]
 

bool CP_FileSystemSpec_Imp::fIsValid [protected]
 

flag to indicate if the file exists in the platforms file system

FSRef CP_FileSystemSpec_Imp::fRef [protected]
 

flag to indicate if this object holds a valid specification for a file, which may or may not currently exist in the file system.

CP_String CP_FileSystemSpec_Imp::fName [protected]
 

MacOS FSRef to the file


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:21:46 2005 for CPLAT_MacOS by  doxygen 1.4.0