InetProtTextUtils Class Reference

#include <inetprottextutils.h>

class InetProtTextUtils

Detailed Description

Comments :

Member Enumeration Documentation

Enum TRemoveMode

enum TRemoveMode Enum defining whitespace removal modes.

EnumeratorValueDescription
ERemoveLeft0

Specifies removal any contiguous whitespace characters at the beginning of some data.

ERemoveRight

Specifies removal any contiguous whitespace characters at the end of some data.

ERemoveBoth

Specifies removal any contiguous whitespace characters at the beginning and end of some data.

Member Function Documentation

ConvertDescriptorToHex ( const TDesC8 &, TInt & )

IMPORT_C TIntConvertDescriptorToHex(const TDesC8 &aData,
TInt &aHex
)[static]

Descriptor to hex convertor. Searches the descriptor buffer for a hex number representation at the start of the buffer. The hex number is deemed to have ended when the first non-hex character is found. The numeric value of the hex number is returned along with the number characters consumed in obtaining the number. The amount of leading whitespace is included in the number of characters consumed.

Parameters
aDataThe descriptor buffer to be parsed.
aHexAn output argument set to the numeric value of the parsed hex number.
Return Value
The number of characters consumed in parsing the hex number. If the descriptor was empty then KUriUtilsErrEmptyData is returned. If no hex number was parsed then KUriUtilsErrNoIntergerInData is returned.

ConvertDescriptorToHex ( const TDesC16 &, TInt & )

IMPORT_C TIntConvertDescriptorToHex(const TDesC16 &aData,
TInt &aHex
)[static]

Descriptor to hex convertor. Searches the descriptor buffer for a hex number representation at the start of the buffer. The hex number is deemed to have ended when the first non-hex character is found. The numeric value of the hex number is returned along with the number characters consumed in obtaining the number. The amount of leading whitespace is included in the number of characters consumed.

Parameters
aDataThe descriptor buffer to be parsed.
aHexAn output argument set to the numeric value of the parsed hex number.
Return Value
The number of characters consumed in parsing the hex number. If the descriptor was empty then KUriUtilsErrEmptyData is returned. If no hex number was parsed then KUriUtilsErrNoIntergerInData is returned.

ConvertDescriptorToInt ( const TDesC8 &, TInt & )

IMPORT_C TIntConvertDescriptorToInt(const TDesC8 &aData,
TInt &aInt
)[static]

Converts the character representation of an integer into its numeric value. Preceeding whitespace is ignored and the integer is delimited by either the end of the data, whitespace or any other character other than 0 to 9.

Parameters
aDataA descriptor pointer with the data.
aIntAn output argument in which the numeric value of the data is placed.
Return Value
The number of consumed characters that contributed to the integer value, including any whitespace before the integer. If the data is empty the error code KUriUtilsErrEmptyData is returned. If there are no digits at the beginning of the data the error code KUriUtilsErrNoIntergerInData is returned.

ConvertDescriptorToInt ( const TDesC16 &, TInt & )

IMPORT_C TIntConvertDescriptorToInt(const TDesC16 &aData,
TInt &aInt
)[static]

Converts the character representation of an integer into its numeric value. Preceeding whitespace is ignored and the integer is delimited by either the end of the data, whitespace or any other character other than 0 to 9.

Parameters
aDataA descriptor pointer with the data.
aIntAn output argument in which the numeric value of the data is placed.
Return Value
The number of consumed characters that contributed to the integer value, including any whitespace before the integer. If the data is empty the error code KUriUtilsErrEmptyData is returned. If there are no digits at the beginning of the data the error code KUriUtilsErrNoIntergerInData is returned.

ConvertHexToDescriptorL ( TInt, HBufC8 *& )

IMPORT_C voidConvertHexToDescriptorL(TIntaHex,
HBufC8 *&aBuffer
)[static]

Converts an integer to its hex representation.

Parameters
aHexThe integer value to convert.
aBufferAn output argument that is set to the buffer containing the hex representation of aValue.
Panic Codes
EInvariantFalseThe integer value was too big.

ConvertHexToDescriptorL ( TInt, HBufC16 *& )

IMPORT_C voidConvertHexToDescriptorL(TIntaHex,
HBufC16 *&aBuffer
)[static]

Converts an integer to its hex representation.

Parameters
aHexThe integer value to convert.
aBufferAn output argument that is set to the buffer containing the hex representation of aValue.
Panic Codes
EInvariantFalseThe integer value was too big.

ConvertIntToDescriptorL ( TInt, HBufC8 *& )

IMPORT_C voidConvertIntToDescriptorL(TIntaInt,
HBufC8 *&aBuffer
)[static]

Converts an integer value into its decimal character representation.

Parameters
aIntAn integer value.
aBufferAn output argument of a pointer to a data buffer that will contain the character representation of the integer value.

ConvertIntToDescriptorL ( TInt, HBufC16 *& )

IMPORT_C voidConvertIntToDescriptorL(TIntaInt,
HBufC16 *&aBuffer
)[static]

Converts an integer value into its decimal character representation.

Parameters
aIntAn integer value.
aBufferAn output argument of a pointer to a data buffer that will contain the character representation of the integer value.

ExtractIntegerValueL ( TPtrC8 &, TInt &, TBool )

IMPORT_C TIntExtractIntegerValueL(TPtrC8 &aBuffer,
TInt &aIntVal,
TBoolaAllowNonWsTerminator
)[static]

Extract an integer value from the head of the supplied buffer.

Parameters
aBufferThe buffer containing the integer value.
aIntValAn output argument in which extracted integer value is placed.
aAllowNonWsTerminatorIf set to true whitespace is considered as the terminator, if set to false a non-decimal charecter is considered as terminator.
Return Value
The number of characters in aBuffer after the integer.
Leave Codes
KUriUtilsErrMalformedIntegerif the value in aBuffer is not an integer (ie, contains non-decimal characters, or is too big to fit in a TInt)

ExtractNextTokenFromList ( TPtrC8 &, TPtrC8 &, TChar )

IMPORT_C TIntExtractNextTokenFromList(TPtrC8 &aBuffer,
TPtrC8 &aToken,
TCharaSeparator
)[static]

Extract a token from the head of the supplied buffer, which is assumed to be a token-list. The tokens are separated by the specified character. Any white space surrounding the token is stripped out. The number of characters consumed from the buffer are returned. The buffer is updated to not include the extracted token including the separator.

Parameters
aBufferThe buffer containing the token-list.
aTokenAn output argument containing the extracted token.
aSeparatorThe separator character.
Return Value
The number of characters consumed from the buffer.

ExtractNextTokenFromList ( TPtrC16 &, TPtrC16 &, TChar )

IMPORT_C TIntExtractNextTokenFromList(TPtrC16 &aBuffer,
TPtrC16 &aToken,
TCharaSeparator
)[static]

Extract a token from the head of the supplied buffer, which is assumed to be a token-list. The tokens are separated by the specified character. Any white space surrounding the token is stripped out. The number of characters consumed from the buffer are returned. The buffer is updated to not include the extracted token including the separator.

Parameters
aBufferThe buffer containing the token-list.
aTokenAn output argument containing the extracted token.
aSeparatorThe separator character.
Return Value
The number of characters consumed from the buffer.

ExtractNextTokenFromList ( TPtrC8 &, TPtrC8 &, const TDesC8 & )

IMPORT_C TIntExtractNextTokenFromList(TPtrC8 &aBuffer,
TPtrC8 &aToken,
const TDesC8 &aSeparators
)[static]

Extract a token from the head of the supplied buffer, which is assumed to be a token-list. The tokens are separated by one of the specified characters. Any white space surrounding the token is stripped out. The number of characters consumed from the buffer are returned. The buffer is updated to not include the extracted token including the separator.

Parameters
aBufferThe buffer containing the token-list.
aTokenAn output argument containing the extracted token.
aSeparatorsThe list of separator characters.
Return Value
The number of characters consumed from the buffer.

ExtractNextTokenFromList ( TPtrC16 &, TPtrC16 &, const TDesC16 & )

IMPORT_C TIntExtractNextTokenFromList(TPtrC16 &aBuffer,
TPtrC16 &aToken,
const TDesC16 &aSeparators
)[static]

Extract a token from the head of the supplied buffer, which is assumed to be a token-list. The tokens are separated by one of the specified characters. Any white space surrounding the token is stripped out. The number of characters consumed from the buffer are returned. The buffer is updated to not include the extracted token including the separator.

Parameters
aBufferThe buffer containing the token-list.
aTokenAn output argument containing the extracted token.
aSeparatorsThe list of separator characters.
Return Value
The number of characters consumed from the buffer.

ExtractQuotedStringL ( TPtrC8 &, TPtrC8 & )

IMPORT_C TIntExtractQuotedStringL(TPtrC8 &aBuffer,
TPtrC8 &aQuotedString
)[static]

Extract a quoted string value from the head of the supplied buffer. Anything outside the quotes is discarded and the quotes themselves are not included in the returned string.

Parameters
aBufferThe buffer containing the quoted.
aQuotedStringAn output argument containing the extracted string.
Return Value
The number of characters consumed from the buffer.

ExtractQuotedStringL ( TPtrC16 &, TPtrC16 & )

IMPORT_C TIntExtractQuotedStringL(TPtrC16 &aBuffer,
TPtrC16 &aQuotedString
)[static]

Extract a quoted string value from the head of the supplied buffer. Anything outside the quotes is discarded and the quotes themselves are not included in the returned string.

Parameters
aBufferThe buffer containing the quoted.
aQuotedStringAn output argument containing the extracted string.
Return Value
The number of characters consumed from the buffer.

RemoveWhiteSpace ( TPtrC8 &, TRemoveMode )

IMPORT_C TIntRemoveWhiteSpace(TPtrC8 &aData,
TRemoveModeaMode
)[static]

Removes any contiguous whitespace at the extremes of the data, as specified by aMode. Whitespace is defined by the functions TChar::IsSpace() - white space includes spaces, tabs, and separators (e.g. new line).

Parameters
aDataA descriptor pointer with the data.
aModeThe specified removal mode.
Return Value
The number of consumed whitespace characters. If the data is empty or the data is all whitespace the error code KUriUtilsErrEmptyData is returned.

RemoveWhiteSpace ( TPtrC16 &, TRemoveMode )

IMPORT_C TIntRemoveWhiteSpace(TPtrC16 &aData,
TRemoveModeaMode
)[static]

Removes any contiguous whitespace at the extremes of the data, as specified by aMode. Whitespace is defined by the functions TChar::IsSpace() - white space includes spaces, tabs, and separators (e.g. new line).

Parameters
aDataA descriptor pointer with the data.
aModeThe specified removal mode.
Return Value
The number of consumed whitespace characters. If the data is empty or the data is all whitespace the error code KUriUtilsErrEmptyData is returned.