Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
Mem Class Reference

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

#include <e32std.h>

Static Public Member Functions

static TUint8 * Copy (TAny *aTrg, const TAny *aSrc, TInt aLength)
 Copies data from a source location to a target location and returns a pointer to the end of the copied data.
 
static TUint8 * Move (TAny *aTrg, const TAny *aSrc, TInt aLength)
 Moves a block of data from a source location to a target location and returns a pointer to the end of the moved data.
 
static void Fill (TAny *aTrg, TInt aLength, TChar aChar)
 Fills a specified block of data with a specified character, replacing any existing content.
 
static void FillZ (TAny *aTrg, TInt aLength)
 Fills a specified block of data with binary zeroes (i.e.
 
static TInt Compare (const TUint8 *aLeft, TInt aLeftL, const TUint8 *aRight, TInt aRightL)
 Compares a block of data at one specified location with a block of data at another specified location.
 
static IMPORT_C TInt Compare (const TUint16 *aLeft, TInt aLeftL, const TUint16 *aRight, TInt aRightL)
 Compares a block of data at one specified location with a block of data at another specified location.
 
static IMPORT_C TInt CompareF (const TUint8 *aLeft, TInt aLeftL, const TUint8 *aRight, TInt aRightL)
 Compares a block of data at one specified location with a block of data at another specified location, using the standard folding method appropriate to the current locale.
 
static IMPORT_C TInt CompareF (const TUint16 *aLeft, TInt aLeftL, const TUint16 *aRight, TInt aRightL)
 Compares a block of data at one specified location with a block of data at another specified location, using the standard folding method appropriate to the current locale.
 
static IMPORT_C TInt CompareC (const TUint8 *aLeft, TInt aLeftL, const TUint8 *aRight, TInt aRightL)
 Compares a block of data at one specified location with a block of data at another specified location using the standard collation method appropriate to the current locale.
 
static IMPORT_C TInt CompareC (const TUint16 *aLeft, TInt aLeftL, const TUint16 *aRight, TInt aRightL)
 Compares a block of data at one specified location with a block of data at another specified location using the standard collation method appropriate to the current locale.
 
static IMPORT_C TInt CompareC (const TUint16 *aLeft, TInt aLeftL, const TUint16 *aRight, TInt aRightL, TInt aMaxLevel, const TCollationMethod *aCollationMethod)
 Compares a block of data at one location with a block of data at another location using the specified collation method and collating to the specified maximum collation level.
 
static IMPORT_C TInt CollationMethods ()
 Gets the number of collation methods in this locale.
 
static IMPORT_C TUint CollationMethodId (TInt aIndex)
 Gets the Uid associated with the specified collation method.
 
static IMPORT_C const TCollationMethod * CollationMethodByIndex (TInt aIndex)
 Gets the collation method identified by the specified index.
 
static IMPORT_C const TCollationMethod * CollationMethodById (TUint aId)
 Gets the collation method identified by the specified Uid.
 
static IMPORT_C const TCollationMethod * GetDefaultMatchingTable ()
 Gets the collation method specific for matching purpose.
 
static IMPORT_C void Swap (TAny *aPtr1, TAny *aPtr2, TInt aLength)
 Swaps a number of bytes of data between two specified locations.
 
static IMPORT_C void Crc (TUint16 &aCrc, const TAny *aPtr, TInt aLength)
 Performs a CCITT CRC checksum on the specified data.
 
static IMPORT_C void Crc32 (TUint32 &aCrc, const TAny *aPtr, TInt aLength)
 Performs a CCITT CRC-32 checksum on the specified data.
 

Detailed Description

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.

API status
Published to all clients. Released API.

Definition at line 4957 of file e32std.h.

Member Function Documentation

◆ CollationMethodById()

static IMPORT_C const TCollationMethod * Mem::CollationMethodById ( TUint  aId)
static

Gets the collation method identified by the specified Uid.

This function is only defined for 16 bit (Unicode) build variants. This means that the function is not defined for 8 bit build variants, even when an explicit 16 bit descriptor is used.

Parameters
aIdThe Uid of a collation method in the set of collation methods in this locale.

(generated from Symbian Developer Library)

◆ CollationMethodByIndex()

static IMPORT_C const TCollationMethod * Mem::CollationMethodByIndex ( TInt  aIndex)
static

Gets the collation method identified by the specified index.

This function is only defined for 16 bit (Unicode) build variants. This means that the function is not defined for 8 bit build variants, even when an explicit 16 bit descriptor is used.

Parameters
aIndexAn index into the set of collation methods in this locale. This value is relative to zero; i.e. a zero value refers to the first collation method. This value must not be negative, and must be less than the total number of collation methods in this locale.

Panic condition: USER 132 In debug builds only, if aIndex is negative or is greater than or equal to the total number of collation methods in this locale.

(generated from Symbian Developer Library)

◆ CollationMethodId()

static IMPORT_C TUint Mem::CollationMethodId ( TInt  aIndex)
static

Gets the Uid associated with the specified collation method.

This function is only defined for 16 bit (Unicode) build variants. This means that the function is not defined for 8 bit build variants, even when an explicit 16 bit descriptor is used.

Parameters
aIndexAn index into the set of collation methods in thie locale. This value is relative to zero; i.e. a zero value refers to the first collation method. This value must not be negative, and must be less than the total number of collation methods in this locale.

Panic condition: USER 132 In debug builds only, if aIndex is negative or is greater than or equal to the total number of collation methods in this locale.

(generated from Symbian Developer Library)

◆ CollationMethods()

static IMPORT_C TInt Mem::CollationMethods ( )
static

Gets the number of collation methods in this locale.

This function is only defined for 16 bit (Unicode) build variants. This means that the function is not defined for 8 bit build variants, even when an explicit 16 bit descriptor is used.

(generated from Symbian Developer Library)

◆ Compare() [1/2]

static IMPORT_C TInt Mem::Compare ( const TUint16 *  aLeft,
TInt  aLeftL,
const TUint16 *  aRight,
TInt  aRightL 
)
static

Compares a block of data at one specified location with a block of data at another specified location.

The comparison proceeds on a double-byte for double-byte basis, the result of the comparison is based on the difference of the first pair of bytes to disagree.

The data at the two locations are equal if they have the same length and content. Where the lengths are different and the shorter section of data is the same as the first part of the longer section of data, the shorter is considered to be less than the longer.

Parameters
aLeftA pointer to the first (or left) block of 16 bit data to be compared.
aLeftLThe length of the first (or left) block of data to be compared i.e. the number of double-bytes.
aRightA pointer to the second (or right) block of 16 bit data to be compared.
aRightLThe length of the second (or right) block of data to be compared i.e. the number of double-bytes.

(generated from Symbian Developer Library)

◆ Compare() [2/2]

static TInt Mem::Compare ( const TUint8 *  aLeft,
TInt  aLeftL,
const TUint8 *  aRight,
TInt  aRightL 
)
inlinestatic

Compares a block of data at one specified location with a block of data at another specified location.

The comparison proceeds on a byte for byte basis, the result of the comparison is based on the difference of the first bytes to disagree.

The data at the two locations are equal if they have the same length and content. Where the lengths are different and the shorter section of data is the same as the first part of the longer section of data, the shorter is considered to be less than the longer.

Parameters
aLeftA pointer to the first (or left) block of 8 bit data to be compared.
aLeftLThe length of the first (or left) block of data to be compared, i.e. the number of bytes.
aRightA pointer to the second (or right) block of 8 bit data to be compared.
aRightLThe length of the second (or right) block of data to be compared i.e. the number of bytes.

(generated from Symbian Developer Library)

◆ CompareC() [1/3]

static IMPORT_C TInt Mem::CompareC ( const TUint16 *  aLeft,
TInt  aLeftL,
const TUint16 *  aRight,
TInt  aRightL 
)
static

Compares a block of data at one specified location with a block of data at another specified location using the standard collation method appropriate to the current locale.

Mem::Compare

Parameters
aLeftA pointer to the first (or left) block of 16 bit data to be compared.
aLeftLThe length of the first (or left) block of data to be compared i.e. the number of double-bytes).
aRightA pointer to the second (or right) block of 16 bit data to be compared.
aRightLThe length of the second (or right) block of data to be compared i.e. the number of double-bytes.

(generated from Symbian Developer Library)

◆ CompareC() [2/3]

static IMPORT_C TInt Mem::CompareC ( const TUint16 *  aLeft,
TInt  aLeftL,
const TUint16 *  aRight,
TInt  aRightL,
TInt  aMaxLevel,
const TCollationMethod *  aCollationMethod 
)
static

Compares a block of data at one location with a block of data at another location using the specified collation method and collating to the specified maximum collation level.

If no collation method is supplied, a default method, appropriate to the current locale, is used.

This function is only defined for 16 bit (Unicode) build variants. This means that the function is not defined for 8 bit build variants, even when an explicit 16 bit descriptor is used.

Parameters
aLeftA pointer to the first (or left) block of 16 bit data to be compared.
aLeftLThe length of the first (or left) block of data to be compared. This is the number of double-bytes.
aRightA pointer to the second (or right) block of 16 bit data to be compared.
aRightLThe length of the second (or right) block of data to be compared. This is the number of double-bytes.
aMaxLevelThe maximum collation level.
aCollationMethodA pointer to the collation method or NULL.

(generated from Symbian Developer Library)

◆ CompareC() [3/3]

static IMPORT_C TInt Mem::CompareC ( const TUint8 *  aLeft,
TInt  aLeftL,
const TUint8 *  aRight,
TInt  aRightL 
)
static

Compares a block of data at one specified location with a block of data at another specified location using the standard collation method appropriate to the current locale.

Mem::Compare

Parameters
aLeftA pointer to the first (or left) block of 8 bit data to be compared.
aLeftLThe length of the first (or left) block of data to be compared i.e. the number of bytes.
aRightA pointer to the second (or right) block of 8 bit data to be compared.
aRightLThe length of the second (or right) block of data to be compared i.e. the number of bytes.

(generated from Symbian Developer Library)

◆ CompareF() [1/2]

static IMPORT_C TInt Mem::CompareF ( const TUint16 *  aLeft,
TInt  aLeftL,
const TUint16 *  aRight,
TInt  aRightL 
)
static

Compares a block of data at one specified location with a block of data at another specified location, using the standard folding method appropriate to the current locale.

Mem::Compare

Parameters
aLeftA pointer to the first (or left) block of 16 bit data to be compared.
aLeftLThe length of the first (or left) block of data to be compared i.e. the number of double-bytes.
aRightA pointer to the second (or right) block of 16 bit data to be compared.
aRightLThe length of the second (or right) block of data to be compared i.e the number of double-bytes.

(generated from Symbian Developer Library)

◆ CompareF() [2/2]

static IMPORT_C TInt Mem::CompareF ( const TUint8 *  aLeft,
TInt  aLeftL,
const TUint8 *  aRight,
TInt  aRightL 
)
static

Compares a block of data at one specified location with a block of data at another specified location, using the standard folding method appropriate to the current locale.

Mem::Compare

Parameters
aLeftA pointer to the first (or left) block of 8 bit data to be compared.
aLeftLThe length of the first (or left) block of data to be compared, i.e. the number of bytes.
aRightA pointer to the second (or right) block of 8 bit data to be compared.
aRightLThe length of the second (or right) block of data to be compared, i.e. the number of bytes.

(generated from Symbian Developer Library)

◆ Copy()

static TUint8 * Mem::Copy ( TAny *  aTrg,
const TAny *  aSrc,
TInt  aLength 
)
inlinestatic

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.

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

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

(generated from Symbian Developer Library)

◆ Crc()

static IMPORT_C void Mem::Crc ( TUint16 &  aCrc,
const TAny *  aPtr,
TInt  aLength 
)
static

Performs a CCITT CRC checksum on the specified data.

On return from this function, the referenced 16 bit integer contains the checksummed value.

Parameters
aCrcA reference to a 16 bit integer to contain the checksummed value.
aPtrA pointer to the start of the data to be checksummed.
aLengthThe length of the data to be checksummed.

(generated from Symbian Developer Library)

◆ Crc32()

static IMPORT_C void Mem::Crc32 ( TUint32 &  aCrc,
const TAny *  aPtr,
TInt  aLength 
)
static

Performs a CCITT CRC-32 checksum on the specified data.

On return from this function, the referenced 32 bit integer contains the CRC value.

Parameters
aCrcA reference to a 32 bit integer to contain the CRC value.
aPtrA pointer to the start of the data to be checksummed.
aLengthThe length of the data to be checksummed.

(generated from Symbian Developer Library)

◆ Fill()

static void Mem::Fill ( TAny *  aTrg,
TInt  aLength,
TChar  aChar 
)
inlinestatic

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.

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

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

(generated from Symbian Developer Library)

◆ FillZ()

static void Mem::FillZ ( TAny *  aTrg,
TInt  aLength 
)
inlinestatic

Fills a specified block of data with binary zeroes (i.e.

0x00), replacing any existing content.

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

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

(generated from Symbian Developer Library)

◆ GetDefaultMatchingTable()

static IMPORT_C const TCollationMethod * Mem::GetDefaultMatchingTable ( )
static

Gets the collation method specific for matching purpose.

This function is only defined for 16 bit (Unicode) build variants. This means that the function is not defined for 8 bit build variants, even when an explicit 16 bit descriptor is used.

(generated from Symbian Developer Library)

◆ Move()

static TUint8 * Mem::Move ( TAny *  aTrg,
const TAny *  aSrc,
TInt  aLength 
)
inlinestatic

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.

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

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

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

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

(generated from Symbian Developer Library)

◆ Swap()

static IMPORT_C void Mem::Swap ( TAny *  aPtr1,
TAny *  aPtr2,
TInt  aLength 
)
static

Swaps a number of bytes of data between two specified locations.

The source and target areas can overlap.

Parameters
aPtr1A pointer to the first location taking part in the swap.
aPtr2A pointer to second location taking part in the swap.
aLengthThe number of bytes to be swapped between the two locations. This value must not be negative.

Panic condition: USER 94 In debug builds only, if aLength is negative.

(generated from Symbian Developer Library)


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