DirPath Class Reference

Represents and validates a directory pathname, rather than a file pathname. More...

#include <pathname.h>

Inheritance diagram for DirPath:

PathName CCObject SimpleCCObject List of all members.

Public Member Functions

 DirPath ()
 DirPath class constructors.
 DirPath (const DirPath &)
 DirPath (const String_256 &)
BOOL SetDirPath (const String_256 &)
 Parses a string representing a path and sets up the class variables filetype, filename and location if the path is valid otherwise it sets them to null strings.
virtual BOOL IsValid (const String_256 &) const
 Parses a string representing a directory path and sets up the class variables filetype, filename and location if the path is valid. Cannot do the usual 8.3 checking of things like filenames as this is no longer valid given Chicago and NT non-FAT filing systems.
virtual BOOL IsValid () const
 Says whether the pathname currently in the class has been parsed correctly. This should only be used if the non-blank contructors have been called and more specifically the contructor which takes a pathname as a parameter has been used. This function then returns the result of the validation that happens in the constructor as of course constructors cannot return results!

Protected Member Functions

virtual BOOL IsValidAndReturnInfo (const String_256 &, String_256 &, String_256 &, String_256 &, String_256 &, BOOL=TRUE) const
 Parses a string representing a directory path and returns if it's valid or not. It also splits the string up into drivename, location and last directory name in the list. (it does this because it's overriding the pathname version, and can be useful if you know what it's doing !).

Detailed Description

Represents and validates a directory pathname, rather than a file pathname.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/2/1996
Returns:
Errors: None.

Definition at line 170 of file pathname.h.


Constructor & Destructor Documentation

DirPath::DirPath  ) 
 

DirPath class constructors.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/2/96

Definition at line 1665 of file pathname.cpp.

01665                  : PathName()
01666 {
01667 }

DirPath::DirPath const DirPath  ) 
 

Definition at line 1668 of file pathname.cpp.

01668                                        : PathName(newPath)
01669 {
01670 }

DirPath::DirPath const String_256  ) 
 

Definition at line 1671 of file pathname.cpp.

01671                                        : PathName(path)
01672 {
01673 }


Member Function Documentation

BOOL DirPath::IsValid  )  const [virtual]
 

Says whether the pathname currently in the class has been parsed correctly. This should only be used if the non-blank contructors have been called and more specifically the contructor which takes a pathname as a parameter has been used. This function then returns the result of the validation that happens in the constructor as of course constructors cannot return results!

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/2/96
Returns:
TRUE if the present pathname has been parsed successfully or FALSE otherwise
See also:
DirPath::IsValid(const String_256& path);
Returns:
Errors: If it fails then it will call set error with the error found.

Reimplemented from PathName.

Definition at line 1733 of file pathname.cpp.

01734 {
01735     return PathName::IsValid();
01736 }

BOOL DirPath::IsValid const String_256 path  )  const [virtual]
 

Parses a string representing a directory path and sets up the class variables filetype, filename and location if the path is valid. Cannot do the usual 8.3 checking of things like filenames as this is no longer valid given Chicago and NT non-FAT filing systems.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/2/96
Parameters:
path - String representing a pathname [INPUTS]
Returns:
TRUE if the directory pathname is parsed successfully or FALSE otherwise

Errors: If it fails then it will call set error with the error found.

Reimplemented from PathName.

Definition at line 1711 of file pathname.cpp.

01712 {
01713     return PathName::IsValid(path);
01714 }

BOOL DirPath::IsValidAndReturnInfo const String_256 ConstPath,
String_256 tempFilename,
String_256 tempLocation,
String_256 tempFiletype,
String_256 tempDrivename,
BOOL  SetErrors = TRUE
const [protected, virtual]
 

Parses a string representing a directory path and returns if it's valid or not. It also splits the string up into drivename, location and last directory name in the list. (it does this because it's overriding the pathname version, and can be useful if you know what it's doing !).

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/2/96
Parameters:
ConstPath - String representing the pathname to check [INPUTS] SetErrors - Flag to say whether we should set errors or not (defaults to TRUE)
tempFilename - String representing the filename (last entry in the path list) [OUTPUTS] tempLocation - String representing the location (all entries before the last) tempFiletype - String representing the filetype (probably empty with dir names) tempDrivename - String representing the drive name
Returns:
TRUE if the dirpath is parsed successfully or FALSE otherwise
Routine called by IsValid to actually go and do the work involved with checking the pathname. Done this way so that internal calls do not have to parse the data again to get at the variables.

Returns:
Errors: If it fails then it will call set error with the error found. This can now be supressed if required.

Reimplemented from PathName.

Definition at line 1771 of file pathname.cpp.

01773 {
01774     // This routine doesn't actually do very much because it was found that the pathname class
01775     // returns ok for "C:\"... Possibly the FilePath class should detect this and return FALSE ?
01776     
01777     return PathName::IsValidAndReturnInfo(ConstPath, tempFilename, tempLocation, tempFiletype,
01778         tempDrivename, SetErrors);
01779 }

BOOL DirPath::SetDirPath const String_256 path  ) 
 

Parses a string representing a path and sets up the class variables filetype, filename and location if the path is valid otherwise it sets them to null strings.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/2/96
Parameters:
path - String representing a pathname [INPUTS]
Returns:
TRUE if the directory pathname is parsed successfully or FALSE otherwise

Errors: None

Definition at line 1690 of file pathname.cpp.

01691 {
01692     return PathName::SetPathName(path);
01693 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:53:40 2007 for Camelot by  doxygen 1.4.4