You can useTParse::Set()
to perform a simple which
retrieves components of the path name. RFs::Parse()
uses default
and related paths.
_LIT(KSpec,"A:file1");
_LIT(KRelated,"C:\\path1\\related.xxx");
TParse fp;
fp.Set(KSpec,&KRelated,NULL);
The following table following table shows filenames and their component parts and the result of the parse:
|
The resultingfp.fullname
will be
A:\path1\file1.xxx.
All the components that are specified in the
file specification (drive and filename) are put into the result; any missing
components (path and extension) are taken from the related file specification
which has next order of precedence; nothing is specified in the default.
You can use wildcards in the filename and extension.
TParse fp; _LIT(KSpec,"A:file1");
_LIT(KDefault,"C:\\path1\\*.*"); fp.Set(KSpec,NULL,&KDefault);
The following table following table shows filenames and their component parts and the result of the parse:
|
The resultingfp.fullname
will be
A:\path1\file1.*