Location:
f32file.h
Link against: efsrv.lib
TParseBase
Supported from 5.0
Base class for file name parsing.
After the path to be parsed has been set up using the
TParse
class, the TParsePtr
class or the
TParsePtrC
class, the path name interrogation and extraction
functions provided by this class can be used.
These functions allow programs to test whether a component has been specified in the pathname, and if so, to extract it. If a component is not present in the pathname, the extraction function returns an empty string.
This class also provides functions which allow directories to be added to and popped from the path.
Note:
these functions cannot be used by the TParsePtrC
class.
Navigation using .. and . is not supported.
Defined in TParseBase
:
AddDir()
, Drive()
, DriveAndPath()
, DrivePresent()
, Ext()
, ExtPresent()
, FullName()
, IsExtWild()
, IsKMatchAny()
, IsKMatchOne()
, IsNameWild()
, IsRoot()
, IsWild()
, Name()
, NameAndExt()
, NameOrExtPresent()
, NamePresent()
, Path()
, PathPresent()
, PopDir()
, TParseBase()
const TDesC& FullName() const;
Gets the complete file specification. This is in the form:
drive-letter: \path\filename.extension
|
TPtrC Drive() const;
Gets the drive letter. The drive letter is in the form:
drive-letter:
Note:
The drive letter is folded (using class
TCharF
).
|
TPtrC Path() const;
Gets the path. The path is in the form:
\path\
|
TPtrC DriveAndPath() const;
Gets the drive letter and path. This is in the form
drive-letter:\path\
Note:
The drive letter is folded (using class
TCharF
).
|
TPtrC Name() const;
Gets the filename. This is in the form
filename
|
TPtrC Ext() const;
Gets the extension. This is in the form:
-extension
|
TPtrC NameAndExt() const;
Gets the filename and extension. This is in the form:
filename - ext
|
TBool DrivePresent() const;
Tests whether a drive is present. Note that this function refers to a
component in the aName
argument specified in calls
toTParse::Set()
, TParse::SetNoWild()
orRFs::Parse()
— not to the resulting fully parsed
file specification.
|
TBool PathPresent() const;
Gets whether a path is present. Note that this function refers to a
component in the aName
argument specified in calls
toTParse::Set()
, TParse::SetNoWild()
orRFs::Parse()
— not to the resulting fully parsed
file specification.
|
TBool NamePresent() const;
Tests whether a file name is present. Note that this function refers to a
component in the aName
argument specified in calls
toTParse::Set()
, TParse::SetNoWild()
orRFs::Parse()
— not to the resulting fully parsed
file specification.
This function returns true even if the filename specified
inaName
contains only wildcards. It only returns
FALSE
if nothing is specified.
|
TBool ExtPresent() const;
Tests whether an extension is present. Note that this function refers to
a component in the aName
argument specified in calls
toTParse::Set()
, TParse::SetNoWild()
orRFs::Parse()
— not to the resulting fully parsed
file specification.
This function returns true even if the extension contains only wildcards. It only returns false if nothing is specified.
|
TBool NameOrExtPresent() const;
Tests whether a filename or an extension are present. Note that this
function refers to a component in the aName
argument specified in
calls to TParse::Set()
, TParse::SetNoWild()
orRFs::Parse()
— not to the resulting fully parsed
file specification.
This function returns true even if the filename or extension specified
inaName
contain only wildcards. It only returns false if nothing
is specified.
|
TBool IsRoot() const;
Tests whether the path in the fully parsed specification is the root directory.
|
TBool IsWild() const;
Tests whether either the filename or extension in the fully parsed specification contains one or more wildcard characters.
|
TBool IsNameWild() const;
Tests whether the filename in the fully parsed specification contains one or more wildcard characters.
|
TBool IsExtWild() const;
Tests whether the extension in the fully parsed specification contains one or more wildcard characters.
|
TBool IsKMatchAny() const;
Tests whether either the name or extension contains asterisk wildcards.
|
TBool IsKMatchOne() const;
Tests whether either the name or extension contains a question mark wildcard.
|
TInt PopDir();
Removes the last directory from the path in the fully parsed specification. This function may be used to navigate up one level in a directory hierarchy. An error is returned if the specified directory is the root.
|
TInt AddDir(const TDesC& aName);
Adds a single directory onto the end of the path in the fully parsed specification. The directory is inserted between the final directory and the filename, if there is one.
|
|