BaflUtils Class Reference

class BaflUtils

Provides simple-to-use file system utilities.

The functions listed in "Copying, renaming, and deleting files" create and use a CFileMan object. They are useful for one-off calls, but for repeated use it is more efficient to use CFileMan directly.

Note that there is a very similiar group of functions available in EikFileUtils, which may be easier to use in GUI applications, as they do not require a file server session to be passed.

CFileMan

EikFileUtils

Public Member Functions
IMPORT_C voidAbbreviateFileName(const TFileName &, TDes &)
IMPORT_C TIntCheckFolder(RFs &, const TDesC &)
IMPORT_C TIntCheckWhetherFullNameRefersToFolder(const TDesC &, TBool &)
IMPORT_C TIntCopyFile(RFs &, const TDesC &, const TDesC &, TUint)
IMPORT_C voidCopyWithTruncation(TDes &, const TDesC &, TChar)
IMPORT_C TIntDeleteFile(RFs &, const TDesC &, TUint)
IMPORT_C TIntDiskIsReadOnly(RFs &, const TDesC &, TBool &)
IMPORT_C TFileNameDriveAndPathFromFullName(const TDesC &)
IMPORT_C TIntDriveIsReadOnlyInternal(RFs &, const TDesC &, TBool &)
IMPORT_C voidEnsurePathExistsL(RFs &, const TDesC &)
IMPORT_C TPtrCExtractAppNameFromFullName(const TFullName &)
IMPORT_C TBoolFileExists(const RFs &, const TDesC &)
IMPORT_C TBoolFolderExists(RFs &, const TDesC &)
IMPORT_C TFileNameFolderNameFromFullName(const TDesC &)
IMPORT_C voidGetDiskListL(const RFs &, CDesCArray &)
IMPORT_C voidGetDowngradePathL(const RFs &, const TLanguage, RArray< TLanguage > &)
IMPORT_C voidGetEquivalentLanguageList(TLanguage, TLanguagePath &)
IMPORT_C TIntGetSystemDrive(TDriveNumber &)
IMPORT_C TLanguageIdealLanguage()
IMPORT_C voidInitialiseHAL(RFs &)
IMPORT_C voidInitialiseLocale(RFs &)
IMPORT_C voidInitialiseScreenCalibration(RFs &)
IMPORT_C TBoolIsFirstDriveForSocket(TDriveUnit)
IMPORT_C TIntIsFolder(const RFs &, const TDesC &, TBool &)
IMPORT_C TIntMostSignificantPartOfFullName(const TDesC &, TFileName &)
IMPORT_C voidNearestLanguageFile(const RFs &, TFileName &)
IMPORT_C voidNearestLanguageFile(const RFs &, TFileName &, TLanguage &)
IMPORT_C voidNearestLanguageFileV2(const RFs &, TFileName &, TLanguage &)
IMPORT_C TIntParse(const TDesC &)
IMPORT_C TBoolPathExists(RFs &, const TDesC &)
IMPORT_C TIntPersistHAL()
IMPORT_C voidPersistLocale()
IMPORT_C voidPersistScreenCalibration(const TDigitizerCalibration &)
IMPORT_C voidReleaseIdealLanguage()
IMPORT_C voidRemoveSystemDirectory(CDir &)
IMPORT_C TIntRenameFile(RFs &, const TDesC &, const TDesC &, TUint)
IMPORT_C TFileNameRootFolderPath(const TBuf< 1 >)
IMPORT_C TIntSetIdealLanguage(TLanguage)
IMPORT_C TIntSortByTable(CDir &, CBaflFileSortTable *)
IMPORT_C TBoolUidTypeMatches(const TUidType &, const TUidType &)
IMPORT_C voidUpdateDiskListL(const RFs &, CDesCArray &, TBool, TDriveNumber)
IMPORT_C TIntValidateFolderNameTypedByUserL(const RFs &, const TDesC &, const TDesC &, TFileName &)
Private Member Functions
voidDoCopyFileL(RFs &, const TDesC &, const TDesC &, TUint)
voidDoDeleteFileL(RFs &, const TDesC &, TUint)
voidDoRenameFileL(RFs &, const TDesC &, const TDesC &, TUint)

Member Functions Documentation

AbbreviateFileName(const TFileName &, TDes &)

IMPORT_C voidAbbreviateFileName(const TFileName &aOriginalFileName,
TDes &aAbbreviatedFileName
)[static]

Parameters

const TFileName & aOriginalFileName
TDes & aAbbreviatedFileName

CheckFolder(RFs &, const TDesC &)

IMPORT_C TIntCheckFolder(RFs &aFs,
const TDesC &aFolderName
)[static]

Parameters

RFs & aFs
const TDesC & aFolderName

CheckWhetherFullNameRefersToFolder(const TDesC &, TBool &)

IMPORT_C TIntCheckWhetherFullNameRefersToFolder(const TDesC &aFullName,
TBool &aIsFolder
)[static]

Parameters

const TDesC & aFullName
TBool & aIsFolder

CopyFile(RFs &, const TDesC &, const TDesC &, TUint)

IMPORT_C TIntCopyFile(RFs &aFs,
const TDesC &aSourceFullName,
const TDesC &aTargetFullName,
TUintaSwitch = CFileMan::EOverWrite
)[static]

Parameters

RFs & aFs
const TDesC & aSourceFullName
const TDesC & aTargetFullName
TUint aSwitch = CFileMan::EOverWrite

CopyWithTruncation(TDes &, const TDesC &, TChar)

IMPORT_C voidCopyWithTruncation(TDes &aDest,
const TDesC &aSrc,
TCharaTruncationSymbol =  KBaflCharTruncation
)[static]

Parameters

TDes & aDest
const TDesC & aSrc
TChar aTruncationSymbol =  KBaflCharTruncation

DeleteFile(RFs &, const TDesC &, TUint)

IMPORT_C TIntDeleteFile(RFs &aFs,
const TDesC &aSourceFullName,
TUintaSwitch = 0
)[static]

Parameters

RFs & aFs
const TDesC & aSourceFullName
TUint aSwitch = 0

DiskIsReadOnly(RFs &, const TDesC &, TBool &)

IMPORT_C TIntDiskIsReadOnly(RFs &aFs,
const TDesC &aFullName,
TBool &aIsReadOnly
)[static]

Parameters

RFs & aFs
const TDesC & aFullName
TBool & aIsReadOnly

DoCopyFileL(RFs &, const TDesC &, const TDesC &, TUint)

voidDoCopyFileL(RFs &aFs,
const TDesC &aSourceFullName,
const TDesC &aTargetFullName,
TUintaSwitch
)[private, static]

Parameters

RFs & aFs
const TDesC & aSourceFullName
const TDesC & aTargetFullName
TUint aSwitch

DoDeleteFileL(RFs &, const TDesC &, TUint)

voidDoDeleteFileL(RFs &aFs,
const TDesC &aSourceFullName,
TUintaSwitch
)[private, static]

Parameters

RFs & aFs
const TDesC & aSourceFullName
TUint aSwitch

DoRenameFileL(RFs &, const TDesC &, const TDesC &, TUint)

voidDoRenameFileL(RFs &aFs,
const TDesC &aOldFullName,
const TDesC &aNewFullName,
TUintaSwitch
)[private, static]

Parameters

RFs & aFs
const TDesC & aOldFullName
const TDesC & aNewFullName
TUint aSwitch

DriveAndPathFromFullName(const TDesC &)

IMPORT_C TFileNameDriveAndPathFromFullName(const TDesC &aFullName)[static]

Parameters

const TDesC & aFullName

DriveIsReadOnlyInternal(RFs &, const TDesC &, TBool &)

IMPORT_C TIntDriveIsReadOnlyInternal(RFs &aFs,
const TDesC &aFullName,
TBool &aIsReadOnlyInternal
)[static]

Parameters

RFs & aFs
const TDesC & aFullName
TBool & aIsReadOnlyInternal

EnsurePathExistsL(RFs &, const TDesC &)

IMPORT_C voidEnsurePathExistsL(RFs &aFs,
const TDesC &aFileName
)[static]

Parameters

RFs & aFs
const TDesC & aFileName

ExtractAppNameFromFullName(const TFullName &)

IMPORT_C TPtrCExtractAppNameFromFullName(const TFullName &aName)[static]

Parameters

const TFullName & aName

FileExists(const RFs &, const TDesC &)

IMPORT_C TBoolFileExists(const RFs &aFs,
const TDesC &aFileName
)[static]

Parameters

const RFs & aFs
const TDesC & aFileName

FolderExists(RFs &, const TDesC &)

IMPORT_C TBoolFolderExists(RFs &aFs,
const TDesC &aFolderName
)[static]

Parameters

RFs & aFs
const TDesC & aFolderName

FolderNameFromFullName(const TDesC &)

IMPORT_C TFileNameFolderNameFromFullName(const TDesC &aFullName)[static]

Parameters

const TDesC & aFullName

GetDiskListL(const RFs &, CDesCArray &)

IMPORT_C voidGetDiskListL(const RFs &aFs,
CDesCArray &aArray
)[static]

Parameters

const RFs & aFs
CDesCArray & aArray

GetDowngradePathL(const RFs &, const TLanguage, RArray< TLanguage > &)

IMPORT_C voidGetDowngradePathL(const RFs &aFs,
const TLanguageaCurrentLanguage,
RArray< TLanguage > &aLanguageArray
)[static]

Parameters

const RFs & aFs
const TLanguage aCurrentLanguage
RArray< TLanguage > & aLanguageArray

GetEquivalentLanguageList(TLanguage, TLanguagePath &)

IMPORT_C voidGetEquivalentLanguageList(TLanguageaLang,
TLanguagePath &aEquivalents
)[static]

Parameters

TLanguage aLang
TLanguagePath & aEquivalents

GetSystemDrive(TDriveNumber &)

IMPORT_C TIntGetSystemDrive(TDriveNumber &aDriveNumber)[static]

Parameters

TDriveNumber & aDriveNumber

IdealLanguage()

IMPORT_C TLanguageIdealLanguage()[static]

InitialiseHAL(RFs &)

IMPORT_C voidInitialiseHAL(RFs &aFs)[static]

Parameters

RFs & aFs

InitialiseLocale(RFs &)

IMPORT_C voidInitialiseLocale(RFs &aFs)[static]

Parameters

RFs & aFs

InitialiseScreenCalibration(RFs &)

IMPORT_C voidInitialiseScreenCalibration(RFs &aFs)[static]

Parameters

RFs & aFs

IsFirstDriveForSocket(TDriveUnit)

IMPORT_C TBoolIsFirstDriveForSocket(TDriveUnitaDriveUnit)[static]

Parameters

TDriveUnit aDriveUnit

IsFolder(const RFs &, const TDesC &, TBool &)

IMPORT_C TIntIsFolder(const RFs &aFs,
const TDesC &aFullName,
TBool &aIsFolder
)[static]

Parameters

const RFs & aFs
const TDesC & aFullName
TBool & aIsFolder

MostSignificantPartOfFullName(const TDesC &, TFileName &)

IMPORT_C TIntMostSignificantPartOfFullName(const TDesC &aFullName,
TFileName &aMostSignificantPart
)[static]

Parameters

const TDesC & aFullName
TFileName & aMostSignificantPart

NearestLanguageFile(const RFs &, TFileName &)

IMPORT_C voidNearestLanguageFile(const RFs &aFs,
TFileName &aName
)[static]

Parameters

const RFs & aFs
TFileName & aName

NearestLanguageFile(const RFs &, TFileName &, TLanguage &)

IMPORT_C voidNearestLanguageFile(const RFs &aFs,
TFileName &aName,
TLanguage &aLanguage
)[static]

Parameters

const RFs & aFs
TFileName & aName
TLanguage & aLanguage

NearestLanguageFileV2(const RFs &, TFileName &, TLanguage &)

IMPORT_C voidNearestLanguageFileV2(const RFs &aFs,
TFileName &aName,
TLanguage &aLanguage
)[static]

Parameters

const RFs & aFs
TFileName & aName
TLanguage & aLanguage

Parse(const TDesC &)

IMPORT_C TIntParse(const TDesC &aName)[static]

Parameters

const TDesC & aName

PathExists(RFs &, const TDesC &)

IMPORT_C TBoolPathExists(RFs &aFs,
const TDesC &aFileName
)[static]

Parameters

RFs & aFs
const TDesC & aFileName

PersistHAL()

IMPORT_C TIntPersistHAL()[static]

PersistLocale()

IMPORT_C voidPersistLocale()[static]

PersistScreenCalibration(const TDigitizerCalibration &)

IMPORT_C voidPersistScreenCalibration(const TDigitizerCalibration &aScreenCalibration)[static]

Parameters

const TDigitizerCalibration & aScreenCalibration

ReleaseIdealLanguage()

IMPORT_C voidReleaseIdealLanguage()[static]

RemoveSystemDirectory(CDir &)

IMPORT_C voidRemoveSystemDirectory(CDir &aDir)[static]

Parameters

CDir & aDir

RenameFile(RFs &, const TDesC &, const TDesC &, TUint)

IMPORT_C TIntRenameFile(RFs &aFs,
const TDesC &aOldFullName,
const TDesC &aNewFullName,
TUintaSwitch = CFileMan::EOverWrite
)[static]

Parameters

RFs & aFs
const TDesC & aOldFullName
const TDesC & aNewFullName
TUint aSwitch = CFileMan::EOverWrite

RootFolderPath(const TBuf< 1 >)

IMPORT_C TFileNameRootFolderPath(const TBuf< 1 >aDriveLetter)[static]

Parameters

const TBuf< 1 > aDriveLetter

SetIdealLanguage(TLanguage)

IMPORT_C TIntSetIdealLanguage(TLanguageaLanguage)[static]

Parameters

TLanguage aLanguage

SortByTable(CDir &, CBaflFileSortTable *)

IMPORT_C TIntSortByTable(CDir &aDir,
CBaflFileSortTable *aTable
)[static]

Parameters

CDir & aDir
CBaflFileSortTable * aTable

UidTypeMatches(const TUidType &, const TUidType &)

IMPORT_C TBoolUidTypeMatches(const TUidType &aFileUid,
const TUidType &aMatchUid
)[static]

Parameters

const TUidType & aFileUid
const TUidType & aMatchUid

UpdateDiskListL(const RFs &, CDesCArray &, TBool, TDriveNumber)

IMPORT_C voidUpdateDiskListL(const RFs &aFs,
CDesCArray &aArray,
TBoolaIncludeRom,
TDriveNumberaDriveNumber
)[static]

Parameters

const RFs & aFs
CDesCArray & aArray
TBool aIncludeRom
TDriveNumber aDriveNumber

ValidateFolderNameTypedByUserL(const RFs &, const TDesC &, const TDesC &, TFileName &)

IMPORT_C TIntValidateFolderNameTypedByUserL(const RFs &aFs,
const TDesC &aFolderNameTypedByUser,
const TDesC &aCurrentPath,
TFileName &aNewFolderFullName
)[static]

Parameters

const RFs & aFs
const TDesC & aFolderNameTypedByUser
const TDesC & aCurrentPath
TFileName & aNewFolderFullName