Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: apacmdln.h
Link against: apparc.lib

Class CApaCommandLine

CApaCommandLine

Support

Supported from 5.0

Description

Information for launching an application.

This is often referred to as a command line and contains:

The information is held in a buffer implemented by a heap descriptor.

Derivation

CApaCommandLineInformation for launching an application
CBaseBase class for all classes to be instantiated on the heap

Defined in CApaCommandLine:
Command(), DocumentName(), FullCommandLine(), LibraryName(), New(), NewL(), NewLC(), SetCommandL(), SetDocumentNameL(), SetFullCommandLine(), SetFullCommandLineL(), SetLibraryNameL(), SetReserveLengthL(), SetTailEndL(), TailEnd(), ~CApaCommandLine()

Inherited from CBase:
operator new()


Construction and destruction


New()

static CApaCommandLine* New(HBufC* aCmdLine);

Description

Creates a command line object, taking ownership of the heap descriptor containing the launch information.

The function cannot leave.

Parameters

HBufC* aCmdLine

A heap descriptor containing the launch information.

Return value

CApaCommandLine*

A pointer to the new command line object.


NewL()

static CApaCommandLine* NewL();

Description

Creates an empty command line object.

Return value

CApaCommandLine*

A pointer to the new command line object.


NewLC()

static CApaCommandLine* NewLC();

Description

Creates an empty command line object, and puts a pointer to it onto the cleanup stack.

Return value

CApaCommandLine*

A pointer to the new command line object.


NewL()

static CApaCommandLine* NewL(const TDesC& aCmdLine);

Description

Creates a command line object taking launch information from the specified descriptor.

Parameters

const TDesC& aCmdLine

A descriptor containing the launch information.

Return value

CApaCommandLine*

A pointer to the new command line object.


NewLC()

static CApaCommandLine* NewLC(const TDesC& aCmdLine);

Description

Creates a command line object taking launch information from the specified descriptor, and puts a pointer to the new object onto the cleanup stack .

Parameters

const TDesC& aCmdLine

A descriptor containing the launch information.

Return value

CApaCommandLine*

A pointer to the new command line object.


~CApaCommandLine()

~CApaCommandLine();

Description

Destructor.

Frees resources owned by the object prior to deletion.

[Top]


Accessors


FullCommandLine()

TPtrC FullCommandLine() const;

Description

Gets the full launch information.

Return value

TPtrC

A pointer descriptor representing the launch information.


Command()

TApaCommand Command() const;

Description

Gets the command code from the launch information.

Return value

TApaCommand

The command code.


DocumentName()

TPtrC DocumentName() const;

Description

Gets the document name from the launch information.

Return value

TPtrC

A pointer descriptor representing the document name. The document name is returned without any enclosing quotation marks. If the launch information contains no document name, then the pointer descriptor has zero length.


LibraryName()

TPtrC LibraryName() const;

Description

Gets the name of the DLL from the launch information.

Return value

TPtrC

A pointer descriptor representing the DLL name. The DLL name is returned without any enclosing quotation marks. If the launch information contains no DLL name name, then the pointer descriptor has zero length.


TailEnd()

TPtrC8 TailEnd() const;

Description

Gets the trailing data from the launch information.

Return value

TPtrC8

A pointer descriptor representing the trailing data. If the launch information contains no trailing data, then the pointer descriptor has zero length.

[Top]


Changing application launch information


SetFullCommandLineL()

void SetFullCommandLineL(const TDesC& aCmdLine);

Description

Sets full launch information from the specified descriptor.

Parameters

const TDesC& aCmdLine

A descriptor containing the launch information.


SetFullCommandLine()

void SetFullCommandLine(HBufC* aCmdLine);

Description

Sets full launch information from the specified heap descriptor, taking ownership of that heap descriptor.

Parameters

HBufC* aCmdLine

A heap descriptor containing the launch information.


SetCommandL()

void SetCommandL(TApaCommand aCommand);

Description

Sets the command code.

Parameters

TApaCommand aCommand

The command code.


SetDocumentNameL()

void SetDocumentNameL(const TDesC& aDocName);

Description

Sets the document name from the specified descriptor.

If the document name has embedded spaces, then it must be enclosed within quotation marks.

Parameters

const TDesC& aDocName

A descriptor containing the document name.


SetLibraryNameL()

void SetLibraryNameL(const TDesC& aLibName);

Description

Sets the DLL name from the specified descriptor.

If the DLL name has embedded spaces, then it must be enclosed within quotation marks.

Parameters

const TDesC& aLibName

A descriptor containing the DLL name.


SetTailEndL()

void SetTailEndL(const TDesC8& aTailEnd);

Description

Sets the trailing data.

Parameters

const TDesC8& aTailEnd

An 8 bit descriptor containing the trailing data.


SetReserveLengthL()

void SetReserveLengthL(TInt aMaxLength);

Description

Sets the length of the internal buffer that holds the launch information.

Use of this function allows a potential out of memory problem to be dealt with separately from the code that sets the launch information.

Parameters

TInt aMaxLength

Length of the internal buffer. If there is no existing launch information, then this can be any positive value. If there is existing launch information, then this value cannot be less than the length of the existing launch information, otherwise the function raises a panic.

See also: