FILEPATH Class Reference

System file and directory services class. More...

#include <mi32/filepath.h>

List of all members.

Public Types

enum  CHILDTYPE { CHILDTYPE_Directory = 1, CHILDTYPE_File }
enum  FILESYSTYPE {
  FILESYSTYPE_Unknown, FILESYSTYPE_NoRootDir, FILESYSTYPE_Removable, FILESYSTYPE_Fixed,
  FILESYSTYPE_Network, FILESYSTYPE_CDROM, FILESYSTYPE_RamDisk
}
enum  PATHTYPE {
  PATHTYPE_Current = 0, PATHTYPE_Home = 1, PATHTYPE_ExecutableFile = 2, PATHTYPE_Desktop = 3,
  PATHTYPE_Font = 4, PATHTYPE_InstallationFolder = 7, PATHTYPE_ExecutableFolder = 8, PATHTYPE_Documents_AllUsers = 9,
  PATHTYPE_MicroImages_Shared = 10, PATHTYPE_Documents_CurrentUser = 11, PATHTYPE_MicroImages_User = 12, PATHTYPE_Settings_CurInst_CurUser = 13,
  PATHTYPE_Settings_CurInst_AllUsers = 14, PATHTYPE_Settings_AllInst_CurUser = 15, PATHTYPE_Settings_AllInst_AllUsers = 16, PATHTYPE_MicroImages_Logs = 17,
  PATHTYPE_AppData_MicroImages_CurUser = 18, PATHTYPE_AppData_MicroImages_AllUsers = 19, PATHTYPE_MicroImages_CurInst_Doc = 20
}
enum  PERMISSION {
  PERMISSION_Invalid = 0, PERMISSION_Exists = 1, PERMISSION_Read = 2, PERMISSION_Write = 3,
  PERMISSION_ReadWrite = 4, PERMISSION_Execute = 5, PERMISSION_AddChild = 6
}
enum  RELATIVEPATH { RELATIVEPATH_Default = 0x00, RELATIVEPATH_NoEncoding = 0x01, RELATIVEPATH_NoDotSlashPrefix = 0x02 }

Public Member Functions

 FILEPATH (void *IniHandle, const char *group, const char *field)
 FILEPATH (const char *rhs, CHAR_ENCODING encoding=CHAR_ENCODING_ASCII)
 FILEPATH (const MIUNICODE *rhs)
 FILEPATH (const MISTRING &rhs)
 FILEPATH (PATHTYPE type)
 FILEPATH (const FILEPATH &dir, const char *name, CHAR_ENCODING encoding=CHAR_ENCODING_ASCII)
 FILEPATH (const FILEPATH &dir, const MIUNICODE *name)
 FILEPATH (const FILEPATH &dir, const MISTRING &name)
 FILEPATH (const FILEPATH &rhs)
 FILEPATH ()
 ~FILEPATH ()
FILEPATHAppend (const char *q, CHAR_ENCODING encoding)
FILEPATHAssign (const char *p, CHAR_ENCODING encoding=CHAR_ENCODING_ASCII)
ERRVALUE CheckAccess (const PERMISSION perm=PERMISSION_Read) const
void Clear ()
bool Contains (const FILEPATH &SubPath) const
ERRVALUE CopyFileFrom (const FILEPATH &SourcePath, bool ShowStatus=false) const
void CopyFileFromDetached (const FILEPATH &SourcePath, MISTATUSMANAGER *DftManager=0) const
bool Exists () const
char * GenerateEncodedOSPath () const
ERRVALUE GenerateTempFile (const FILEPATH &BasePath, const MISTRING &Basename, const char *extn="tmp")
INT64 GetAvailableSpace () const
int GetChildren (MISTRINGLIST &ChildList, const MISTRING &pattern, CHILDTYPE ChildType) const
int GetChildren (MISTRINGLIST &ChildList, CHILDTYPE ChildType) const
int GetComponents (MISTRINGLIST &CompList) const
MISTRING GetDisplay () const
MISTRING GetEncoded () const
MISTRING GetExtension () const
FILESYSTYPE GetFileSysType () const
UINT32 GetFullPathSizeLimit () const
MISTRING GetName () const
MISTRING GetNameOnly () const
UINT32 GetNameSizeLimit () const
INT32 GetOptimalTransferSize () const
MISTRING GetOSPath () const
FILEPATH GetPathOnly () const
PERMISSION GetPermission () const
MISTRING GetQuotedPath () const
MISTRING GetRelativePath (const FILEPATH &BasePath, RELATIVEPATH flags, int maxoutlevels=-1, char separator=0) const
MISTRING GetRelativePath (const FILEPATH &BasePath) const
INT64 GetSize () const
INT64 GetSystemMaxSize () const
ERRVALUE GetTimeAccessed (time_t *rettime) const
ERRVALUE GetTimeCreated (time_t *rettime) const
ERRVALUE GetTimeModified (time_t *rettime) const
void GetVolumeName (MISTRING &VolumeName) const
bool HasChildren (CHILDTYPE ChildType) const
bool HasExtension () const
bool IniRead (void *IniHandle, const char *group, const char *field)
void IniWrite (void *IniHandle, const char *group, const char *field) const
bool IsChildPath (const FILEPATH &BasePath) const
bool IsEmpty () const
bool IsEqual (const FILEPATH &TestPath) const
bool IsFile () const
bool IsFolder () const
bool IsLessThan (const FILEPATH &TestPath) const
bool IsPathOnly () const
bool IsReadable () const
bool IsRootOnly () const
bool IsSameExtn (const MISTRING &extn) const
bool IsSameExtn (const char *extn) const
bool IsUNCHostOnly () const
bool IsUNCRoot () const
bool IsWritable () const
ERRVALUE Make (bool MakeTree=false) const
ERRVALUE MakeHardLinkTo (const FILEPATH &SrcFile) const
FILEPATHoperator+= (const char *rhs)
FILEPATHoperator+= (const MIUNICODE *rhs)
FILEPATHoperator+= (const MISTRING &rhs)
FILEPATHoperator= (const MIUNICODE *rhs)
FILEPATHoperator= (const MISTRING &rhs)
FILEPATHoperator= (const FILEPATH &rhs)
ERRVALUE Remove () const
ERRVALUE RemoveFiles (bool RemoveReadOnlyFiles=false) const
ERRVALUE RemoveFolder () const
ERRVALUE Rename (const FILEPATH &newname) const
ERRVALUE Rename (const MISTRING &newname)
FILEPATHReplaceRoot (const FILEPATH &SourcePath)
bool SearchCase ()
FILEPATHSetExtension (const char *extn, CHAR_ENCODING encoding=CHAR_ENCODING_ASCII)
FILEPATHSetExtension (const MISTRING &extn)
FILEPATHSetName (const char *name, CHAR_ENCODING encoding=CHAR_ENCODING_ASCII)
FILEPATHSetName (const MISTRING &name)
ERRVALUE SetPermission (PERMISSION perm) const
void SetSystemPath (PATHTYPE pt)
ERRVALUE SetTimeCreated (time_t value) const
ERRVALUE SetTimeCreated (const tm *const timeval) const
ERRVALUE SetTimeModified (time_t value) const
ERRVALUE SetTimeModified (const tm *const timeval) const
FILEPATHStripExtension ()
FILEPATHStripLastComponent ()
bool StripToCommon (const FILEPATH &testpath)
FILEPATHStripToExisting ()
FILEPATHStripToFolder ()
FILEPATHStripToRoot ()
ERRVALUE UpdateFilesFrom (const FILEPATH &SourcePath, const MISTRING &pattern, bool RecurseSubDirectories=true) const
ERRVALUE UpdateFilesFrom (const FILEPATH &SourcePath, bool RecurseSubDirectories=true) const

Static Public Member Functions

static MISTRING ConvertDisplayToName (const MISTRING &name)
static MISTRING ConvertNameToDisplay (const MISTRING &name)
static int GetDriveList (MISTRINGLIST &DriveList)
static bool GetEnvPath (const char *name, MISTRING &EnvPathStr)
static const MISTRINGGetNonValidComponentChars ()
static bool IsRelativePath (const MIUNICODE *path)
static bool IsRelativePath (const MISTRING &path)
static bool IsValidName (const MISTRING &name)
static bool MakeValidChars (MISTRING &name)
static bool MakeValidName (MISTRING &name)
static void SetModuleFileName (const char *name, CHAR_ENCODING encoding)

Detailed Description

System file and directory services class.


Member Enumeration Documentation

Type of children to select in GetChildren calls.

Enumerator:
CHILDTYPE_Directory 
CHILDTYPE_File 

File system types as can be determined.

Enumerator:
FILESYSTYPE_Unknown 
FILESYSTYPE_NoRootDir 

Root path is invalid, no volume mounted.

FILESYSTYPE_Removable 

Removable media.

FILESYSTYPE_Fixed 

Fixed media.

FILESYSTYPE_Network 

Network.

FILESYSTYPE_CDROM 

CD/DVD, read only file systems.

FILESYSTYPE_RamDisk 

Memory-based filesystem.

Common file path types.

Enumerator:
PATHTYPE_Current 

Current system path, usually same as installation folder.

PATHTYPE_Home 

Users home directory if it exists.

PATHTYPE_ExecutableFile 

Path to the executable file.

PATHTYPE_Desktop 
PATHTYPE_Font 
PATHTYPE_InstallationFolder 

Folder where product is "installed".

PATHTYPE_ExecutableFolder 

Folder containing current process executable.

PATHTYPE_Documents_AllUsers 

All-users "Documents" folder.

PATHTYPE_MicroImages_Shared 

Shared "MicroImages" folder.

PATHTYPE_Documents_CurrentUser 

Current-user "Documents" folder.

PATHTYPE_MicroImages_User 

Current-user "MicroImages" folder.

PATHTYPE_Settings_CurInst_CurUser 

Settings for current 'installation', current user.

PATHTYPE_Settings_CurInst_AllUsers 

Settings for current 'installation', all users.

PATHTYPE_Settings_AllInst_CurUser 

Settings for all 'installations', current user.

PATHTYPE_Settings_AllInst_AllUsers 

Settings for all 'installations', all users.

PATHTYPE_MicroImages_Logs 

Place to put log files (same as MicroImages_User except on Macs where it's (HOME)/Logs/MicroImages.

PATHTYPE_AppData_MicroImages_CurUser 

MicroImages Application Data for current user.

PATHTYPE_AppData_MicroImages_AllUsers 

MicroImages Application Data for all users.

PATHTYPE_MicroImages_CurInst_Doc 

Current installation "doc" folder.

Possible file permissions to set or check for.

Enumerator:
PERMISSION_Invalid 
PERMISSION_Exists 
PERMISSION_Read 
PERMISSION_Write 
PERMISSION_ReadWrite 
PERMISSION_Execute 
PERMISSION_AddChild 
Enumerator:
RELATIVEPATH_Default 
RELATIVEPATH_NoEncoding 

Don't including platform encoding prefix.

RELATIVEPATH_NoDotSlashPrefix 

Don't include ./ prefix if no outward links.


Constructor & Destructor Documentation

FILEPATH::FILEPATH (  )  [inline]

Default constructor, empty path.

FILEPATH::FILEPATH ( const FILEPATH rhs  )  [inline]

Copy constructor.

FILEPATH::FILEPATH ( const FILEPATH dir,
const MISTRING name 
)

Concatenation constructor, 'dir' must be a directory.

FILEPATH::FILEPATH ( const FILEPATH dir,
const MIUNICODE name 
)

Concatenation constructor, 'dir' must be a directory.

FILEPATH::FILEPATH ( const FILEPATH dir,
const char *  name,
CHAR_ENCODING  encoding = CHAR_ENCODING_ASCII 
)

Concatenation constructor, 'dir' must be a directory.

FILEPATH::FILEPATH ( PATHTYPE  type  )  [explicit]

Constructor, inialize with a system path.

FILEPATH::FILEPATH ( const MISTRING rhs  )  [explicit]

Constructor, initialize with MISTRING.

FILEPATH::FILEPATH ( const MIUNICODE rhs  ) 

Constructor, initialize with MIUNICODE*, for compatibility.

FILEPATH::FILEPATH ( const char *  rhs,
CHAR_ENCODING  encoding = CHAR_ENCODING_ASCII 
) [explicit]

Constructor, initialize with C string, for efficiency.

FILEPATH::FILEPATH ( void *  IniHandle,
const char *  group,
const char *  field 
)

Initialize a FILEPATH with an entry from an INI file.

Parameters:
IniHandle Handle to INI file to read from, 0 for default file "tntproc.ini"
group INI group to read path from
field INI field to read path from
FILEPATH::~FILEPATH (  )  [inline]

Destructor.


Member Function Documentation

FILEPATH& FILEPATH::Append ( const char *  q,
CHAR_ENCODING  encoding 
)

Append a string to FILEPATH, adding separator.

Parameters:
q String to append with
encoding Encoding of the string
FILEPATH& FILEPATH::Assign ( const char *  p,
CHAR_ENCODING  encoding = CHAR_ENCODING_ASCII 
)

Assign a character string representation of a path to FILEPATH using the character encoding.

Returns:
Reference to 'this'
ERRVALUE FILEPATH::CheckAccess ( const PERMISSION  perm = PERMISSION_Read  )  const

Check access permissions on the file / directory.

Returns:
0 if access permitted, < 0 if error or EFileNotFound
Parameters:
perm Access permission to check for
void FILEPATH::Clear (  ) 

Clear the path representation.

bool FILEPATH::Contains ( const FILEPATH SubPath  )  const

Check if path contains "subpath" given.

Parameters:
SubPath Subpath to check against
static MISTRING FILEPATH::ConvertDisplayToName ( const MISTRING name  )  [static]

Convert user displayable into a component OS filename Only has an effect on MAC_OSX where the slash '/' is transposed to a colon ':' from displaying.

static MISTRING FILEPATH::ConvertNameToDisplay ( const MISTRING name  )  [static]

Convert component OS filename passed in to a displayable filename.

Only has an effect on MAC_OSX where the colon ':' is transposed to a slash '/' when displaying

ERRVALUE FILEPATH::CopyFileFrom ( const FILEPATH SourcePath,
bool  ShowStatus = false 
) const

Copy contents from SourcePath.

Uses MISTATUSCONTEXT to report file copying progress

Parameters:
SourcePath Source file to copy from
void FILEPATH::CopyFileFromDetached ( const FILEPATH SourcePath,
MISTATUSMANAGER DftManager = 0 
) const

Copy contents from SourcePath.

This method creates a MITHREAD::WORKER_DETACHED derived class to copy the file, therefore this method is asynchronous and will return immediately.

Parameters:
SourcePath Source file to copy from
DftManager Default status manager to assign any job, unless job overrides it
bool FILEPATH::Exists (  )  const

Check if path exists.

char* FILEPATH::GenerateEncodedOSPath (  )  const

Generate Operating system specific path with the proper encoding for character based IO calls.

In some cases this will fail if the path does not exist. Use this method to call functions that take a path ONLY if nothing else can be done and it is a third party library. It is not known if the third party library can handle the multiple encodings if they manipulate the path.

Returns:
Encoded OS filepath, Caller MUST free. Will return NULL on error. If NULL is returned use GetLastErrCode() to determine the error.
ERRVALUE FILEPATH::GenerateTempFile ( const FILEPATH BasePath,
const MISTRING Basename,
const char *  extn = "tmp" 
)

Generate a temp file given a basepath and a basename for the temp file Called by FILEFIND::MakeTempFile().

INT64 FILEPATH::GetAvailableSpace (  )  const

Returns the amount of free space on the volume that the path represents.

int FILEPATH::GetChildren ( MISTRINGLIST ChildList,
const MISTRING pattern,
CHILDTYPE  ChildType 
) const

Obtain a list of child directories or files that exist under this path using a pattern to select which children to find.

Returns:
Number of children found.
Parameters:
ChildList List of child names found after search
pattern Pattern to match
ChildType Type of children to search for CHILDTYPE_Directory or CHILDTYPE_File.
int FILEPATH::GetChildren ( MISTRINGLIST ChildList,
CHILDTYPE  ChildType 
) const

Obtain a list of child directories or files that exist under this path.

Returns:
Number of children found.
Parameters:
ChildList List of child names found after search
ChildType Type of children to search for CHILDTYPE_Directory or CHILDTYPE_File.
int FILEPATH::GetComponents ( MISTRINGLIST CompList  )  const

Separate path into individual components, returns number of components.

Parameters:
CompList List of components RETURNED
MISTRING FILEPATH::GetDisplay (  )  const

Get the display string representation for the path.

Used to get a string that is to be displayed to the end user.

static int FILEPATH::GetDriveList ( MISTRINGLIST DriveList  )  [static]

Determine list of drives / volumes for this OS.

MISTRING FILEPATH::GetEncoded (  )  const

Get OS-independent string representation for the path.

Used to get a string that is to be saved to a permanent database / file for later retrieval. The encoding is used in the case of file transfer to different system types, Eg UNIX -> WIN32 or MAC -> WIN32 or any other combination.

static bool FILEPATH::GetEnvPath ( const char *  name,
MISTRING EnvPathStr 
) [static]

Get an environment variable as a path (or paths) and convert using the correct OS encoding.

MISTRING FILEPATH::GetExtension (  )  const

Get the file name extension, without the extension marker.

The extension is considered to be the string after the last extension marker. Eg. in "test.rvc.txt", 'txt' would be the extension returned.

FILESYSTYPE FILEPATH::GetFileSysType (  )  const

Get type of system drive the path represents.

Returns:
Type of system drive the path represents.
UINT32 FILEPATH::GetFullPathSizeLimit (  )  const

Get maximum amount of characters allowed for an operating system's full path.

Returns:
The operating system's limit for a full path.
MISTRING FILEPATH::GetName (  )  const

Get the last component name (file or folder) with extension (if exists).

Returns:
Last component name
MISTRING FILEPATH::GetNameOnly (  )  const

Get the file name only, no extension, unless directory.

A directory is not considered to have an extension, therefore if this path represents a directory, the name with extension is returned.

UINT32 FILEPATH::GetNameSizeLimit (  )  const

Get maximum amount of characters allowed for an operating system's path segment.

Returns:
The operating system's limit for a path segment / filename.
static const MISTRING& FILEPATH::GetNonValidComponentChars (  )  [static]

Get set of characters which are not valid for a path component.

This will include separators and filesystem specifiers.

INT32 FILEPATH::GetOptimalTransferSize (  )  const

Get the optimal transfer size for the volume/drive specified.

Returns:
The volume's optimal transfer size
MISTRING FILEPATH::GetOSPath (  )  const

Get the OS-dependent Unicode string representation for the path.

Used to generate valid path string for use in OS-specific file I/O functions where Unicode versions are available. Does not insert quotes around components containing spaces.

See also:
GetQuotedPath, GenerateEncodedOSPath
FILEPATH FILEPATH::GetPathOnly (  )  const

Get the path representation only.

PERMISSION FILEPATH::GetPermission (  )  const

Get access permissions on the file / directory.

MISTRING FILEPATH::GetQuotedPath (  )  const

Get path with quotes inserted around components containing spaces.

Used to generate a valid string to use command on lines.

See also:
GetOSPath
MISTRING FILEPATH::GetRelativePath ( const FILEPATH BasePath,
RELATIVEPATH  flags,
int  maxoutlevels = -1,
char  separator = 0 
) const

Generate relative path from specified base with options.

Returns:
Relative path string, see other GetRelativePath() for complete docs
Parameters:
BasePath Base path, which returned string is relative to.
flags Flags
maxoutlevels Maximum number of outward (../) folder levels, -1 if no limit
separator Component separator, 0 to use from platform
MISTRING FILEPATH::GetRelativePath ( const FILEPATH BasePath  )  const

Generate an encoded relative path from a source path.

The string returned will be one of three types: 1. A string == ".", the current path and the source path are equal 2. An encoded string from GetEncoded() method, the two paths are completely unrelated 3. An encoded string with the relative path.

See also IsRelativePath().

Returns:
Relative path string
Parameters:
BasePath Base path which the instance is compared to and the relative path is generated against
INT64 FILEPATH::GetSize (  )  const

Return size of the file.

INT64 FILEPATH::GetSystemMaxSize (  )  const

Return maximum size of a file on the drive represented.

ERRVALUE FILEPATH::GetTimeAccessed ( time_t *  rettime  )  const

Get the access time for the file.

Parameters:
rettime UTC time
ERRVALUE FILEPATH::GetTimeCreated ( time_t *  rettime  )  const

Get the creation time for the file.

Parameters:
rettime UTC time
ERRVALUE FILEPATH::GetTimeModified ( time_t *  rettime  )  const

Get the modification time for the file.

Parameters:
rettime UTC time
void FILEPATH::GetVolumeName ( MISTRING VolumeName  )  const

Get root volume name.

Parameters:
VolumeName Volume name returned, will be blank if cannot determine
bool FILEPATH::HasChildren ( CHILDTYPE  ChildType  )  const

Does the path have children of a specific type?

Returns:
True' if children of the correct type found
Parameters:
ChildType Type of children to search for CHILDTYPE_Directory or CHILDTYPE_File.
bool FILEPATH::HasExtension (  )  const

Does the Name part of the path have an extension?

bool FILEPATH::IniRead ( void *  IniHandle,
const char *  group,
const char *  field 
)

Initialize a FILEPATH with an entry from an INI file.

Returns:
'true' if the entry exists.
Parameters:
IniHandle Handle to INI file to read from, 0 for default file "tntproc.ini"
group INI group to read path from
field INI field to read path from
void FILEPATH::IniWrite ( void *  IniHandle,
const char *  group,
const char *  field 
) const

Write encoded filepath to .ini file.

Parameters:
IniHandle Handle to INI file to write to, 0 for default file "tntproc.ini"
group INI group to write encoded path to
field INI field to write encoded path to
bool FILEPATH::IsChildPath ( const FILEPATH BasePath  )  const

Is the path a child path of 'BasePath'.

bool FILEPATH::IsEmpty (  )  const

Is FILEPATH empty?

bool FILEPATH::IsEqual ( const FILEPATH TestPath  )  const

Are the paths equal?

Case insensitive check for WIN32, MAC.

bool FILEPATH::IsFile (  )  const

Is FILEPATH an existing file?

bool FILEPATH::IsFolder (  )  const

Is FILEPATH an existing folder (directory)?

bool FILEPATH::IsLessThan ( const FILEPATH TestPath  )  const

Is "this" less than testpath?

Case insensitive check for WIN32, MAC.

bool FILEPATH::IsPathOnly (  )  const

Is the file referenced a directory?

A non-existant path is a directory.

bool FILEPATH::IsReadable (  )  const

Is the path / file readable?

static bool FILEPATH::IsRelativePath ( const MIUNICODE path  )  [static]

Determine if relative path using MIUNICODE* string.

Parameters:
path String to determine if a relative path
static bool FILEPATH::IsRelativePath ( const MISTRING path  )  [static]

Is the string given specify a relative path.

A string is considered a relative path if: 1. The string is empty or the string == "." 2. The string starts with a relative path indicator specific for the platform On all but the MAC, the string can start with either the same directory relative path or the parent directory relative path. The MAC does not have a current directory relative path.

Example: if (FILEPATH::IsRelativePath(RelStr)) { FilePath = BasePath; // Assign base path to dest FilePath += RelStr; // Concatinate relative path onto dest } else { FilePath = RelStr; // Full path, assign to dest }

Returns:
'true' if path is a relative path, false if not
Parameters:
path String to determine if a relative path
bool FILEPATH::IsRootOnly (  )  const

Is the path a root path?

bool FILEPATH::IsSameExtn ( const MISTRING extn  )  const

Does the filepath have the same extension as that passed in This method is used to speed up extension checking without creating one or two MISTRINGs This method uses no-case comparisons.

Returns:
True if extensions match or if path has no extension and '0' or "" is passed for 'extn'
Parameters:
extn Do not prepend extension marker '.'
bool FILEPATH::IsSameExtn ( const char *  extn  )  const

Does the filepath have the same extension as that passed in This method is used to speed up extension checking without creating one or two MISTRINGs This method uses no-case comparisons.

Returns:
True if extensions match or if path has no extension and '0' or "" is passed for 'extn'
Parameters:
extn Do not prepend extension marker '.'
bool FILEPATH::IsUNCHostOnly (  )  const

Is the path a UNC host path only? (\\Machine).

bool FILEPATH::IsUNCRoot (  )  const

Is the path a UNC root path? (\\Machine\share).

static bool FILEPATH::IsValidName ( const MISTRING name  )  [static]

Determine if the path component is valid for the current OS.

Returns:
'True' if the component is valid, 'false' if not
bool FILEPATH::IsWritable (  )  const

Is the path / file writable?

(Writable is correct spelling).

ERRVALUE FILEPATH::Make ( bool  MakeTree = false  )  const

Creates a path.

If 'MakeTree' true, will create all non-existant directories listed in its path.

ERRVALUE FILEPATH::MakeHardLinkTo ( const FILEPATH SrcFile  )  const

Creates a hard link to the file 'SrcFile', given the new filename 'this'.

static bool FILEPATH::MakeValidChars ( MISTRING name  )  [static]

Validate characters in path component for the current OS.

Does not check for reserved names.

Returns:
true if name altered, false if not.
static bool FILEPATH::MakeValidName ( MISTRING name  )  [static]

Validate the path component for the current OS.

Returns:
true if name altered, false if not.
FILEPATH& FILEPATH::operator+= ( const char *  rhs  ) 

Concatenate from C string, for efficiency.

Parameters:
rhs ASCII encoded string
FILEPATH& FILEPATH::operator+= ( const MIUNICODE rhs  ) 

Concatenate from MIUNICODE*, adding separator.

FILEPATH& FILEPATH::operator+= ( const MISTRING rhs  ) 

Concatenate from MISTRING, adding separator.

FILEPATH& FILEPATH::operator= ( const MIUNICODE rhs  ) 

Assignment from MIUNICODE*.

FILEPATH& FILEPATH::operator= ( const MISTRING rhs  ) 

Assignment from MISTRING.

FILEPATH& FILEPATH::operator= ( const FILEPATH rhs  )  [inline]

Assignment operator.

ERRVALUE FILEPATH::Remove (  )  const

Remove a file from the system, does not remove directories.

ERRVALUE FILEPATH::RemoveFiles ( bool  RemoveReadOnlyFiles = false  )  const

Remove files and sub-folders from the system.

This method will not remove 'root' folders or system folders. Even so, use this with caution.

ERRVALUE FILEPATH::RemoveFolder (  )  const

Remove a folder from the system, does not remove files.

ERRVALUE FILEPATH::Rename ( const FILEPATH newname  )  const

Move existing file to newpath.

Parameters:
newname Path to change to
ERRVALUE FILEPATH::Rename ( const MISTRING newname  ) 

Rename an existing file with a new name, FILEPATH changed after sucessful operation.

Parameters:
newname Name to change to
FILEPATH& FILEPATH::ReplaceRoot ( const FILEPATH SourcePath  ) 

Replace root of the path with a new root.

Parameters:
SourcePath Path that contains new root path
bool FILEPATH::SearchCase (  ) 

Search for file by changing path case incrementally.

Returns:
"true" if found and FILEPATH will be modified.
FILEPATH& FILEPATH::SetExtension ( const char *  extn,
CHAR_ENCODING  encoding = CHAR_ENCODING_ASCII 
)

Set extension of the path.

FILEPATH& FILEPATH::SetExtension ( const MISTRING extn  ) 

Set extension of the path.

static void FILEPATH::SetModuleFileName ( const char *  name,
CHAR_ENCODING  encoding 
) [static]

Set application executable name so that PATHTYPE_Executable for SetSystemPath() can work.

Only necessary on Unix and in rare cases on Windows

Parameters:
name Name of executable (argv[0] for most systems)
encoding String encoding (CHAR_ENCODING_ASCII for most systems)
FILEPATH& FILEPATH::SetName ( const char *  name,
CHAR_ENCODING  encoding = CHAR_ENCODING_ASCII 
)

Replace FILEPATH name, overloaded for efficiency.

FILEPATH& FILEPATH::SetName ( const MISTRING name  ) 

Replace FILEPATH name.

ERRVALUE FILEPATH::SetPermission ( PERMISSION  perm  )  const

Set access permissions on the file / directory.

Parameters:
perm Permission to set file / directory to
void FILEPATH::SetSystemPath ( PATHTYPE  pt  ) 

Sets FILEPATH to a system path.

Parameters:
pt System path to set FILEPATH to
ERRVALUE FILEPATH::SetTimeCreated ( time_t  value  )  const

Change creation time for a file, if possible.

Parameters:
value UTC based time value
ERRVALUE FILEPATH::SetTimeCreated ( const tm *const   timeval  )  const

Change creation time for a file, if possible.

Parameters:
timeval UTC based time value
ERRVALUE FILEPATH::SetTimeModified ( time_t  value  )  const

Change modification time for a file, if possible.

Parameters:
value UTC based time value
ERRVALUE FILEPATH::SetTimeModified ( const tm *const   timeval  )  const

Change modification time for a file, if possible.

Parameters:
timeval UTC based time value
FILEPATH& FILEPATH::StripExtension (  ) 

Strips the extension, if it exists, off of Name.

FILEPATH& FILEPATH::StripLastComponent (  ) 

Strips the last component off of the path.

bool FILEPATH::StripToCommon ( const FILEPATH testpath  ) 

Strip to portion in common with specified path.

Returns:
True if have common portion, false if not. Result will be empty if returns false.
FILEPATH& FILEPATH::StripToExisting (  ) 

Strips off components until the remaining path exists.

FILEPATH& FILEPATH::StripToFolder (  ) 

Strips off components until the remaining folder path exists.

FILEPATH& FILEPATH::StripToRoot (  ) 

Strips everything off except the root path.

ERRVALUE FILEPATH::UpdateFilesFrom ( const FILEPATH SourcePath,
const MISTRING pattern,
bool  RecurseSubDirectories = true 
) const

Update files from the source path to 'this' if the source file is of a later date.

If the directory referenced by 'this' does not exist, it will be created.

Parameters:
SourcePath Source directory to update files from
pattern Pattern to match
RecurseSubDirectories Update files from subdirectories also
ERRVALUE FILEPATH::UpdateFilesFrom ( const FILEPATH SourcePath,
bool  RecurseSubDirectories = true 
) const

Update files from the source path to 'this' if the source file is of a later date.

If the directory referenced by 'this' does not exist, it will be created.

Parameters:
SourcePath Source directory to update files from
RecurseSubDirectories Update files from subdirectories also

The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:33:22 2012 for TNTsdk 2012 by  doxygen 1.6.1