Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <f32file.h>
Link against: efsrv.lib

Class TParse

class TParse : public TParseBase;

Description

Parses filenames.

The class uses the full filename structure supported by Symbian OS.

TParse works by using the Set() function to set up the filename to be parsed. Then, various getter functions defined in the base class, TParseBase, such as: FullName(), Drive(), Path(), DriveAndPath(), Name(), Ext() and NameAndExt() may be used to retrieve path components.

There are a number of restrictions to valid path components, which are described in guide documentation.

Derivation

Members

Defined in TParse:

Inherited from TParseBase:


Construction and destruction


TParse()

IMPORT_C TParse();

Description

Default constructor.

[Top]


Member functions


Set()

IMPORT_C TInt Set(const TDesC &aName, const TDesC *aRelated, const TDesC *aDefault);

Description

Parses a file specification, allowing wildcards in the filename and extension.

This function sets up the TParse object so that it can be used to provide useful information.

Parameters

const TDesC &aName

The file specification to be parsed.

const TDesC *aRelated

The related file specification. This is optional, set to NULL to omit.

const TDesC *aDefault

The default file specification. This is optional, set to NULL to omit.

Return value

TInt

KErrNone, if successful, otherwise one of the other system-wide error codes.


SetNoWild()

IMPORT_C TInt SetNoWild(const TDesC &aName, const TDesC *aRelated, const TDesC *aDefault);

Description

Parses a file specification; disallows wildcards in any part of the file name or extension.

If you need to specify wildcards use Set(). Otherwise, this function behaves in the same way as Set().

Parameters

const TDesC &aName

The file specification to be parsed.

const TDesC *aRelated

The related file specification. This is optional, set to NULL to omit.

const TDesC *aDefault

The default file specification. This is optional, set to NULL to omit.

Return value

TInt

KErrNone, if successful, otherwise one of the other system-wide error codes.


NameBuf()

protected: virtual IMPORT_C TDes &NameBuf();

Description

Gets a reference to the descriptor containing the file specification passed to the constructor of this object.

Return value

TDes &

A reference to the descriptor containing the filename.


NameBufC()

protected: virtual IMPORT_C const TDesC &NameBufC() const;

Description

Gets a const reference to the descriptor containing the file specification passed to the constructor of this object.

Return value

const TDesC &

A const reference to the descriptor containing the file specification.