System Utils API: Technical specification

Type of interface

The service offered by System Utils is accessed through the System Utils API.

Interface class structure

Figure 1: SysUtil interface

SysUtil provides a static interface, which can be called directly without creating an instance of the class.

Usage

Protocol

The methods of SysUtil API can be called independent of each other. The methods are static, there is no need to initialize SysUtil in any way before calling any of the methods of SysUtil API.

All methods of SysUtil API are synchronous. They can not be canceled.

Error handling
Extensions to the API

None.

Example

The following code shows an example of using the SysUtil class.

// check if the system FFS space goes below critical level if I write 8003 
// bytes there

TBool belowCL = SysUtil::FFSSpaceBelowCriticalLevelL( NULL, 8003 );

Detailed description

SysUtil

This class offers an API for applications to miscellaneous system utilities, such as getting software version information or language package version information.

Methods
GetSWVersion(TDes& aValue)

This method returns the software version string.

Parameters:

Type Name Possible values
TDes& aValue The returned version string. The size of the buffer should be KSysUtilVersionTextLength (currently 64).

Return value:

KErrNone, if successful, or a Symbian OS standard error code.

GetLangSWVersion(TDes& aValue)

This method returns the SW version with which the currently installed language package is compatible.

Parameters:

Type Name Possible values
TDes& aValue The returned version string. The size of the buffer should be KSysUtilVersionTextLength (currently 64).

Return value:

KErrNone, if successful, or a Symbian OS standard error code.

GetLangVersion(TDes& aValue)

This method returns the version of the currently installed language package.

Parameters:

Type Name Possible values
TDes& aValue The returned version string. The size of the buffer should be KSysUtilVersionTextLength (currently 64).

Return value:

KErrNone, if successful, or a Symbian OS standard error code.

FFSSpaceBelowCriticalLevelL(RFs* aFs, TInt aBytesToWrite = 0)

This method checks if the free FFS (internal Flash File System) storage space is or will fall below Critical Level (CL). This module defines the FFS drive letter. Critical level value is defined in Central Repository.

If parameter aBytesToWrite is not defined, this method checks if the system FFS space is already below Critical Level (CL).

Parameters:

Type Name Possible values
RFs* aFs File Server session. Must be given if available in the caller. If NULL, this method creates a temporary session for a check, but then the check is more expensive.
TInt aBytesToWrite Number of bytes the caller is about to write to FFS, if known by the caller beforehand. If the parameter is not supplied, the system default value is used to check if the current space is already below CL.

Return value:

ETrue if storage space would go below CL after adding aBytesToWrite more data, otherwise EFalse. The method leaves on error (for example drive contains no media) with one of system-wide error codes.

MMCSpaceBelowCriticalLevelL(RFs* aFr, TInt aBytesToWrite = 0)

This checks if the free MMC (MultiMedia Card) space is or will fall below Critical Level (CL). Critical level value is defined in Central Repository.

Parameters:

Type Name Possible values
RFs* aFs File Server session. Must be given if available in the caller. If NULL, this method creates a temporary session for a check, but then the check is more expensive.
TInt aBytesToWrite Number of bytes the caller is about to write to MMC, if known by the caller beforehand. If the parameter is not supplied, the system default value is used to check if the current space is already below CL.

Return value:

ETrue if storage space would go below CL after adding aBytesToWrite more data, otherwise EFalse. EFalse if system has no MMC drive support.

The method leaves on error (for example drive contains no media) with one of system-wide error codes.

DiskSpaceBelowCriticalLevelL(RFs* aFs, TInt aBytesToWrite, TInt aDrive)

This is a generic method used to check if free drive storage space is or will fall below Critical Level (CL). Critical level values are defined in Central Repository.

Parameters:

Type Name Possible values
RFs* aFs File Server session. Must be given if available in the caller. If NULL, this method creates a temporary session for a check, but then the check is more expensive.
TInt aBytesToWrite Number of bytes the caller is about to write to disk, if known by the caller beforehand. If the parameter is not supplied, the system default value is used to check if the current space is already below CL.
TInt aDrive Number of the drive to be checked. See TDriveNumber of f32file.H.

Return value:

ETrue if storage space would go below CL after adding aBytesToWrite more data, otherwise EFalse.

The method leaves on error (for example drive contains no media) with one of system-wide error codes.

Code architecture

The interface is accessed through the sysutil.H (SysUtil). The binaries are linked to the SYSUTIL.DLL library.


Copyright © Nokia Corporation 2001-2008
Back to top