Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <e32cmn.h>
Link against: euser.lib

Class TVersion

class TVersion;

Description

Contains version information.

A version is defined by a set of three numbers:

1. the major version number, ranging from 0 to 127, inclusive

2. the minor version number, ranging from 0 to 99 inclusive

3. the build number, ranging from 0 to 32767 inclusive.

The class provides a constructor for setting all three numbers. It also provides a member function to build a character representation of this information in a TVersionName descriptor.

Members

Defined in TVersion:


Construction and destruction


TVersion()

IMPORT_C TVersion();

Description

Default constructor.

It sets the major, minor and build numbers to zero.


TVersion(TInt,TInt,TInt)

IMPORT_C TVersion(TInt aMajor, TInt aMinor, TInt aBuild);

Description

Constructs the object with the specified major version number, the minor version number and the build number.

Note that the constructor does not check that the values passed are within the specified ranges. As the parameters are TInt types, care must be taken to ensure that values passed do not exceed the specified maxima, otherwise they will be interpreted as negative values.

Parameters

TInt aMajor

The major version number. This must be a number in the range 0 to 127.

TInt aMinor

The minor version number. This must be a number in the range 0 to 99.

TInt aBuild

The build number. This must be a number in the range 0 to 32,767.

[Top]


Member functions


Name()const

IMPORT_C TVersionName Name() const;

Description

Gets a descriptor buffer containing the formatted character representation of the version information.

The general format of the representation is: xxx.yy(zzzzz)

where:

1. xxx is the major version number; depending on the value, this may have a length of one, two or three characters.

2. yy is the minor version number; this is always two characters, padded with a leading zero, if necessary.

3. zzzzz is the build number; depending on the value, this may have a length of one to 5 characters.

Note that if the object is constructed with values that exceed the permitted range, they will appear negative in their formatted character representation.

Return value

TBuf

A buffer descriptor containing the formatted character representation.

[Top]


Member data


iMajor

TInt8 iMajor;

Description

The major version number.


iMinor

TInt8 iMinor;

Description

The minor version number.


iBuild

TInt16 iBuild;

Description

The build number.