#include <e32std.h>
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.
IMPORT_C const TCollationMethod * | 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.
Parameter | Description |
---|---|
aId | The Uid of a collation method in the set of collation methods in this locale. |
Returns: A pointer to the collation method.
IMPORT_C const TCollationMethod * | 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.
Parameter | Description |
---|---|
aIndex | An 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. |
Returns: A pointer to the collation method.
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.
Parameter | Description |
---|---|
aIndex | An 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. |
Returns: The Uid of the collation method.
IMPORT_C TInt | 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.
Returns: The number of collation methods.
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.
Parameter | Description |
---|---|
aLeft | A pointer to the first (or left) block of 8 bit data to be compared. |
aLeftL | The length of the first (or left) block of data to be compared, i.e. the number of bytes. |
aRight | A pointer to the second (or right) block of 8 bit data to be compared. |
aRightL | The length of the second (or right) block of data to be compared i.e. the number of bytes. |
Returns: Positive, if the first (or left) block of data is greater than the second (or right) block of data. Negative, if the first (or left) block of data is less than the second (or right) block of data. Zero, if both the first (or left) and second (or right) blocks of data have the same length and the same content.
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.
Parameter | Description |
---|---|
aLeft | A pointer to the first (or left) block of 16 bit data to be compared. |
aLeftL | The length of the first (or left) block of data to be compared i.e. the number of double-bytes. |
aRight | A pointer to the second (or right) block of 16 bit data to be compared. |
aRightL | The length of the second (or right) block of data to be compared i.e. the number of double-bytes. |
Returns: Positive, if the first (or left) block of data is greater than the second (or right) block of data. Negative, if the first (or left) block of data is less than the second (or right) block of data. Zero, if both the first (or left) and second (or right) blocks of data have the same length and the same content.
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.
See also: Mem::Compare
DeprecatedParameter | Description |
---|---|
aLeft | A pointer to the first (or left) block of 8 bit data to be compared. |
aLeftL | The length of the first (or left) block of data to be compared i.e. the number of bytes. |
aRight | A pointer to the second (or right) block of 8 bit data to be compared. |
aRightL | The length of the second (or right) block of data to be compared i.e. the number of bytes. |
Returns: Positive, if the first (or left) block of data is greater than the second (or right) block of data. Negative, if the first (or left) block of data is less than the second (or right) block of data. Zero, if both the first (or left) and second (or right) blocks of data have the same length and the same content.
IMPORT_C TInt | 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.
See also: Mem::Compare
Parameter | Description |
---|---|
aLeft | A pointer to the first (or left) block of 16 bit data to be compared. |
aLeftL | The length of the first (or left) block of data to be compared i.e. the number of double-bytes). |
aRight | A pointer to the second (or right) block of 16 bit data to be compared. |
aRightL | The length of the second (or right) block of data to be compared i.e. the number of double-bytes. |
Returns: Positive, if the first (or left) block of data is greater than the second (or right) block of data. Negative, if the first (or left) block of data is less than the second (or right) block of data. Zero, if both the first (or left) and second (or right) blocks of data have the same length and the same content.
IMPORT_C TInt | 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.
Parameter | Description |
---|---|
aLeft | A pointer to the first (or left) block of 16 bit data to be compared. |
aLeftL | The length of the first (or left) block of data to be compared. This is the number of double-bytes. |
aRight | A pointer to the second (or right) block of 16 bit data to be compared. |
aRightL | The length of the second (or right) block of data to be compared. This is the number of double-bytes. |
aMaxLevel | The maximum collation level. |
aCollationMethod | A pointer to the collation method or NULL. |
Returns: Positive, if this descriptor is greater than the specified descriptor. Negative, if this descriptor is less than the specified descriptor. Zero, if both descriptors have the same length and their contents are the same.
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.
See also: Mem::Compare
Parameter | Description |
---|---|
aLeft | A pointer to the first (or left) block of 8 bit data to be compared. |
aLeftL | The length of the first (or left) block of data to be compared, i.e. the number of bytes. |
aRight | A pointer to the second (or right) block of 8 bit data to be compared. |
aRightL | The length of the second (or right) block of data to be compared, i.e. the number of bytes. |
Returns: Positive, if the first (or left) block of data is greater than the second (or right) block of data. Negative, if the first (or left) block of data is less than the second (or right) block of data. Zero, if both the first (or left) and second (or right) blocks of data have the same length and the same content.
IMPORT_C TInt | 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.
See also: Mem::Compare
Parameter | Description |
---|---|
aLeft | A pointer to the first (or left) block of 16 bit data to be compared. |
aLeftL | The length of the first (or left) block of data to be compared i.e. the number of double-bytes. |
aRight | A pointer to the second (or right) block of 16 bit data to be compared. |
aRightL | The length of the second (or right) block of data to be compared i.e the number of double-bytes. |
Returns: Positive, if the first (or left) block of data is greater than the second (or right) block of data. Negative, if the first (or left) block of data is less than the second (or right) block of data. Zero, if both the first (or left) and second (or right) blocks of data have the same length and the same content.
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.
Parameter | Description |
---|---|
aTrg | A pointer to the target location for the copy operation. |
aSrc | A pointer to the source location for the copy operation. |
aLength | The number of bytes to be copied. This value must not be negative. |
Returns: A pointer to a location aLength bytes beyond aTrg (i.e. the location aTrg+aLength).
Performs a CCITT CRC checksum on the specified data.
On return from this function, the referenced 16 bit integer contains the checksummed value.
Parameter | Description |
---|---|
aCrc | A reference to a 16 bit integer to contain the checksummed value. |
aPtr | A pointer to the start of the data to be checksummed. |
aLength | The length of the data to be checksummed. |
Performs a CCITT CRC-32 checksum on the specified data.
On return from this function, the referenced 32 bit integer contains the CRC value.
Parameter | Description |
---|---|
aCrc | A reference to a 32 bit integer to contain the CRC value. |
aPtr | A pointer to the start of the data to be checksummed. |
aLength | The length of the data to be checksummed. |
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.
Parameter | Description |
---|---|
aTrg | A pointer to the location where filling is to start. |
aLength | The number of bytes to be filled. This value must not be negative. |
aChar | The fill character. |
Fills a specified block of data with binary zeroes (i.e. 0x00), replacing any existing content.
Parameter | Description |
---|---|
aTrg | A pointer to the location where filling is to start. |
aLength | The number of bytes to be filled. This value must not be negative. |
IMPORT_C const TCollationMethod * | 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.
Returns: A pointer to the collation method
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.
Parameter | Description |
---|---|
aTrg | A pointer to the target location for the move operation. This pointer must be word aligned. |
aSrc | A pointer to the source location for the move operation. This pointer must be word aligned. |
aLength | The number of bytes to be copied. This value must be a multiple of 4. |
Returns: A pointer to a location aLength bytes beyond aTrg (i.e. the location aTrg+aLength).
Swaps a number of bytes of data between two specified locations.
The source and target areas can overlap.
Parameter | Description |
---|---|
aPtr1 | A pointer to the first location taking part in the swap. |
aPtr2 | A pointer to second location taking part in the swap. |
aLength | The number of bytes to be swapped between the two locations. This value must not be negative. |