Mem Class Reference

class Mem

Contains a set of static functions which perform manipulation of data in memory.

The arguments passed to the functions of this class are pointers to memory locations and length values. These functions are, therefore, not normally used in open code but are suitable for implementing data manipulation for other classes. Typically the interface provided by such classes is typesafe and hides this direct memory to memory manipulation.

Public Member Functions
IMPORT_C const TCollationMethod *CollationMethodById(TUint)
IMPORT_C const TCollationMethod *CollationMethodByIndex(TInt)
IMPORT_C TUintCollationMethodId(TInt)
IMPORT_C TIntCollationMethods()
IMPORT_C TIntCompare(const TUint8 *, TInt, const TUint8 *, TInt)
IMPORT_C TIntCompare(const TUint16 *, TInt, const TUint16 *, TInt)
IMPORT_C TIntCompareC(const TUint8 *, TInt, const TUint8 *, TInt)
IMPORT_C TIntCompareC(const TUint16 *, TInt, const TUint16 *, TInt)
IMPORT_C TIntCompareC(const TUint16 *, TInt, const TUint16 *, TInt, TInt, const TCollationMethod *)
IMPORT_C TIntCompareF(const TUint8 *, TInt, const TUint8 *, TInt)
IMPORT_C TIntCompareF(const TUint16 *, TInt, const TUint16 *, TInt)
TUint8 *Copy(TAny *, const TAny *, TInt)
IMPORT_C voidCrc(TUint16 &, const TAny *, TInt)
IMPORT_C voidCrc32(TUint32 &, const TAny *, TInt)
voidFill(TAny *, TInt, TChar)
voidFillZ(TAny *, TInt)
IMPORT_C const TCollationMethod *GetDefaultMatchingTable()
TUint8 *Move(TAny *, const TAny *, TInt)
IMPORT_C voidSwap(TAny *, TAny *, TInt)

Member Functions Documentation

CollationMethodById(TUint)

IMPORT_C const TCollationMethod *CollationMethodById(TUintaId)[static]

Parameters

TUint aId

CollationMethodByIndex(TInt)

IMPORT_C const TCollationMethod *CollationMethodByIndex(TIntaIndex)[static]

Parameters

TInt aIndex

CollationMethodId(TInt)

IMPORT_C TUintCollationMethodId(TIntaIndex)[static]

Parameters

TInt aIndex

CollationMethods()

IMPORT_C TIntCollationMethods()[static]

Compare(const TUint8 *, TInt, const TUint8 *, TInt)

IMPORT_C TIntCompare(const TUint8 *aLeft,
TIntaLeftL,
const TUint8 *aRight,
TIntaRightL
)[static]

Parameters

const TUint8 * aLeft
TInt aLeftL
const TUint8 * aRight
TInt aRightL

Compare(const TUint16 *, TInt, const TUint16 *, TInt)

IMPORT_C TIntCompare(const TUint16 *aLeft,
TIntaLeftL,
const TUint16 *aRight,
TIntaRightL
)[static]

Parameters

const TUint16 * aLeft
TInt aLeftL
const TUint16 * aRight
TInt aRightL

CompareC(const TUint8 *, TInt, const TUint8 *, TInt)

IMPORT_C TIntCompareC(const TUint8 *aLeft,
TIntaLeftL,
const TUint8 *aRight,
TIntaRightL
)[static]

Parameters

const TUint8 * aLeft
TInt aLeftL
const TUint8 * aRight
TInt aRightL

CompareC(const TUint16 *, TInt, const TUint16 *, TInt)

IMPORT_C TIntCompareC(const TUint16 *aLeft,
TIntaLeftL,
const TUint16 *aRight,
TIntaRightL
)[static]

Parameters

const TUint16 * aLeft
TInt aLeftL
const TUint16 * aRight
TInt aRightL

CompareC(const TUint16 *, TInt, const TUint16 *, TInt, TInt, const TCollationMethod *)

IMPORT_C TIntCompareC(const TUint16 *aLeft,
TIntaLeftL,
const TUint16 *aRight,
TIntaRightL,
TIntaMaxLevel,
const TCollationMethod *aCollationMethod
)[static]

Parameters

const TUint16 * aLeft
TInt aLeftL
const TUint16 * aRight
TInt aRightL
TInt aMaxLevel
const TCollationMethod * aCollationMethod

CompareF(const TUint8 *, TInt, const TUint8 *, TInt)

IMPORT_C TIntCompareF(const TUint8 *aLeft,
TIntaLeftL,
const TUint8 *aRight,
TIntaRightL
)[static]

Parameters

const TUint8 * aLeft
TInt aLeftL
const TUint8 * aRight
TInt aRightL

CompareF(const TUint16 *, TInt, const TUint16 *, TInt)

IMPORT_C TIntCompareF(const TUint16 *aLeft,
TIntaLeftL,
const TUint16 *aRight,
TIntaRightL
)[static]

Parameters

const TUint16 * aLeft
TInt aLeftL
const TUint16 * aRight
TInt aRightL

Copy(TAny *, const TAny *, TInt)

TUint8 *Copy(TAny *aTrg,
const TAny *aSrc,
TIntaLength
)[static, inline]

Copies data from a source location to a target location and returns a pointer to the end of the copied data.

The source and target areas can overlap.

The copy operation is optimised so that if both source and target locations are aligned on a word boundary, the operation performs the copy on a word by word basis.

A pointer to a location aLength bytes beyond aTrg (i.e. the location aTrg+aLength).

panic

USER 90 In debug builds only, if aLength is negative.

Parameters

TAny * aTrgA pointer to the target location for the copy operation.
const TAny * aSrcA pointer to the source location for the copy operation.
TInt aLengthThe number of bytes to be copied. This value must not be negative.

Crc(TUint16 &, const TAny *, TInt)

IMPORT_C voidCrc(TUint16 &aCrc,
const TAny *aPtr,
TIntaLength
)[static]

Parameters

TUint16 & aCrc
const TAny * aPtr
TInt aLength

Crc32(TUint32 &, const TAny *, TInt)

IMPORT_C voidCrc32(TUint32 &aCrc,
const TAny *aPtr,
TIntaLength
)[static]

Parameters

TUint32 & aCrc
const TAny * aPtr
TInt aLength

Fill(TAny *, TInt, TChar)

voidFill(TAny *aTrg,
TIntaLength,
TCharaChar
)[static, inline]

Fills a specified block of data with a specified character, replacing any existing content.

The function assumes that the fill character is a non-Unicode character.

panic

USER 95 In debug builds only, if aLength is negative.

Parameters

TAny * aTrgA pointer to the location where filling is to start.
TInt aLengthThe number of bytes to be filled. This value must not be negative.
TChar aCharThe fill character.

FillZ(TAny *, TInt)

voidFillZ(TAny *aTrg,
TIntaLength
)[static, inline]

Fills a specified block of data with binary zeroes (i.e. 0x00), replacing any existing content.

panic

USER 95 In debug builds only, if aLength is negative.

Parameters

TAny * aTrgA pointer to the location where filling is to start.
TInt aLengthThe number of bytes to be filled. This value must not be negative.

GetDefaultMatchingTable()

IMPORT_C const TCollationMethod *GetDefaultMatchingTable()[static]

Move(TAny *, const TAny *, TInt)

TUint8 *Move(TAny *aTrg,
const TAny *aSrc,
TIntaLength
)[static, inline]

Moves a block of data from a source location to a target location and returns a pointer to the end of the moved data.

The source and target areas can overlap.

Both source and target locations must be aligned on a word boundary. The specified length must also be a multiple of 4.

A pointer to a location aLength bytes beyond aTrg (i.e. the location aTrg+aLength).

panic

USER 93 In debug builds only, if aTrg is not word aligned.

panic

USER 92 In debug builds only, if aSrc is not word aligned.

panic

USER 91 In debug builds only, if aLength is not a multiple of 4.

Parameters

TAny * aTrgA pointer to the target location for the move operation. This pointer must be word aligned.
const TAny * aSrcA pointer to the source location for the move operation. This pointer must be word aligned.
TInt aLengthThe number of bytes to be copied. This value must be a multiple of 4.

Swap(TAny *, TAny *, TInt)

IMPORT_C voidSwap(TAny *aPtr1,
TAny *aPtr2,
TIntaLength
)[static]

Parameters

TAny * aPtr1
TAny * aPtr2
TInt aLength