SysUtil Class Reference

API published in: S60 2nd Ed

Link against: sysutil.lib

Capability Information

Required Capabilities

None


#include <sysutil.h>

Detailed Description

SysUtil provides various utility methods for applications.

SysUtil API provides functions for applications to retrieve SW and language package versions and check whether there is free space on a disk drive.


Static Public Member Functions

static IMPORT_C TInt  GetSWVersion (TDes &aValue)
  Obtains the software version string.
static IMPORT_C TInt  GetLangSWVersion (TDes &aValue)
  Returns software version which the currently installed language package is compatible with.
static IMPORT_C TInt  GetLangVersion (TDes &aValue)
  Obtains the version of the currently installed language package.
static IMPORT_C TBool  FFSSpaceBelowCriticalLevelL (RFs *aFs, TInt aBytesToWrite=0)
  Checks if free FFS (internal flash file system) storage space is or will fall below critical level.
static IMPORT_C TBool  MMCSpaceBelowCriticalLevelL (RFs *aFs, TInt aBytesToWrite=0)
  Checks if free MMC storage space is or will fall below critical level.
static IMPORT_C TBool  DiskSpaceBelowCriticalLevelL (RFs *aFs, TInt aBytesToWrite, TInt aDrive)
  Checks if free disk drive storage space is or will fall below critical level.

Member Function Documentation

static IMPORT_C TBool SysUtil::DiskSpaceBelowCriticalLevelL RFs *  aFs,
TInt  aBytesToWrite,
TInt  aDrive
[static]
 

Checks if free disk drive storage space is or will fall below critical level.

Static configuration values stored in Central Repository are used to determine a critical level for each drive.

Usage example:

 TInt dataSize = 500;
 if ( SysUtil::DiskSpaceBelowCriticalLevelL( &iFsSession, dataSize, EDriveC ) )
     {
     // Can not write the data, there's not enough free space on disk.
     ...
     }
 else
     {
     // It's ok to actually write the data.
     ...
     }
Parameters:
aFs  File server session. Must be given if available, e.g. from EIKON environment. If NULL, this method will create a temporary session, which causes the method to consume more time and system resources.
aBytesToWrite  Number of bytes the caller is about to write to disk. If value 0 is given, this method checks if the current disk space is already below critical level.
aDrive  Identifies the disk drive to be checked. Numeric values for identifying disk drives are defined in TDriveNumber enumeration.
See also:
TDriveNumber in f32file.h.
Returns:
ETrue if disk space would go below critical level after writing aBytesToWrite more data, EFalse otherwise.
Leave:
Leaves with one of the Symbian error codes if checking the disk space fails, for instance if the drive contains no media or there is not enough free memory to create a temporary connection to file server.
static IMPORT_C TBool SysUtil::FFSSpaceBelowCriticalLevelL RFs *  aFs,
TInt  aBytesToWrite = 0
[static]
 

Checks if free FFS (internal flash file system) storage space is or will fall below critical level.

Static configuration value stored in Central Repository is used to determine the critical level for the FFS drive.

Parameters:
aFs  File server session. Must be given if available, e.g. from EIKON environment. If NULL, this method will create a temporary session, which causes the method to consume more time and system resources.
aBytesToWrite  Number of bytes the caller is about to write to FFS. If value 0 is given, this method checks if the current FFS space is already below critical level.
Returns:
ETrue if FFS space would go below critical level after writing aBytesToWrite more data, EFalse otherwise.
Leave:
Leaves with one of the Symbian error codes if checking the FFS space fails, for instance if there is not enough free memory to create a temporary connection to file server.
static IMPORT_C TInt SysUtil::GetLangSWVersion TDes &  aValue  )  [static]
 

Returns software version which the currently installed language package is compatible with.

Parameters:
aValue  On return, contains the version string. The buffer should have space for KSysUtilVersionTextLength characters.
Returns:
KErrNone on success, or one of the Symbian error codes if reading the version string fails.
static IMPORT_C TInt SysUtil::GetLangVersion TDes &  aValue  )  [static]
 

Obtains the version of the currently installed language package.

Parameters:
aValue  On return, contains the language package version string. The buffer should have space for KSysUtilVersionTextLength characters.
Returns:
KErrNone on success, or one of the Symbian error codes if reading the version string fails.
static IMPORT_C TInt SysUtil::GetSWVersion TDes &  aValue  )  [static]
 

Obtains the software version string.

Usage example:

 TBuf<KSysUtilVersionTextLength> version;
 if ( SysUtil::GetSWVersion( version ) == KErrNone )
     {
     // Use the version string.
     ...
     }
Parameters:
aValue  On return, contains the software version string. The buffer should have space for KSysUtilVersionTextLength characters.
Returns:
KErrNone on success, or one of the Symbian error codes if reading the version string fails.
static IMPORT_C TBool SysUtil::MMCSpaceBelowCriticalLevelL RFs *  aFs,
TInt  aBytesToWrite = 0
[static]
 

Checks if free MMC storage space is or will fall below critical level.

Static configuration value stored in Central Repository is used to determine the critical level for the MMC drive. PathInfo API is used to determine the drive letter for the MMC drive.

Parameters:
aFs  File server session. Must be given if available, e.g. from EIKON environment. If NULL, this method will create a temporary session, which causes the method to consume more time and system resources.
aBytesToWrite  Number of bytes the caller is about to write to MMC. If value 0 is given, this method checks if the current MMC space is already below critical level.
Returns:
ETrue if MMC space would go below critical level after writing aBytesToWrite more data, EFalse otherwise. EFalse if the system has no MMC drive support.
Leave:
Leaves with one of the Symbian error codes if checking the MMC space fails, for instance if the MMC drive contains no media or there is not enough free memory to create a temporary connection to file server.

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top