#include <inetprottextutils.h>
class InetProtTextUtils |
Public Member Enumerations | |
---|---|
enum | TRemoveMode { ERemoveLeft, ERemoveRight, ERemoveBoth } |
Comments :
enum TRemoveMode Enum defining whitespace removal modes.
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.
Parameter | Description |
---|---|
aData | The descriptor buffer to be parsed. |
aHex | An output argument set to the numeric value of the parsed hex number. |
Returns: 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.
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.
Parameter | Description |
---|---|
aData | The descriptor buffer to be parsed. |
aHex | An output argument set to the numeric value of the parsed hex number. |
Returns: 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.
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.
Parameter | Description |
---|---|
aData | A descriptor pointer with the data. |
aInt | An output argument in which the numeric value of the data is placed. |
Returns: 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.
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.
Parameter | Description |
---|---|
aData | A descriptor pointer with the data. |
aInt | An output argument in which the numeric value of the data is placed. |
Returns: 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.
Converts an integer to its hex representation.
Parameter | Description |
---|---|
aHex | The integer value to convert. |
aBuffer | An output argument that is set to the buffer containing the hex representation of aValue. |
Converts an integer to its hex representation.
Parameter | Description |
---|---|
aHex | The integer value to convert. |
aBuffer | An output argument that is set to the buffer containing the hex representation of aValue. |
Converts an integer value into its decimal character representation.
Parameter | Description |
---|---|
aInt | An integer value. |
aBuffer | An output argument of a pointer to a data buffer that will contain the character representation of the integer value. |
Converts an integer value into its decimal character representation.
Parameter | Description |
---|---|
aInt | An integer value. |
aBuffer | An output argument of a pointer to a data buffer that will contain the character representation of the integer value. |
IMPORT_C TInt | ExtractIntegerValueL | ( | TPtrC8 & | aBuffer, |
TInt & | aIntVal, | |||
TBool | aAllowNonWsTerminator | |||
) | [static] |
Extract an integer value from the head of the supplied buffer.
Parameter | Description |
---|---|
aBuffer | The buffer containing the integer value. |
aIntVal | An output argument in which extracted integer value is placed. |
aAllowNonWsTerminator | If set to true whitespace is considered as the terminator, if set to false a non-decimal charecter is considered as terminator. |
Returns: The number of characters in aBuffer after the integer.
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.
Parameter | Description |
---|---|
aBuffer | The buffer containing the token-list. |
aToken | An output argument containing the extracted token. |
aSeparator | The separator character. |
Returns: The number of characters consumed from the buffer.
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.
Parameter | Description |
---|---|
aBuffer | The buffer containing the token-list. |
aToken | An output argument containing the extracted token. |
aSeparator | The separator character. |
Returns: The number of characters consumed from the buffer.
IMPORT_C TInt | ExtractNextTokenFromList | ( | 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.
Parameter | Description |
---|---|
aBuffer | The buffer containing the token-list. |
aToken | An output argument containing the extracted token. |
aSeparators | The list of separator characters. |
Returns: The number of characters consumed from the buffer.
IMPORT_C TInt | ExtractNextTokenFromList | ( | 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.
Parameter | Description |
---|---|
aBuffer | The buffer containing the token-list. |
aToken | An output argument containing the extracted token. |
aSeparators | The list of separator characters. |
Returns: The number of characters consumed from the buffer.
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.
Parameter | Description |
---|---|
aBuffer | The buffer containing the quoted. |
aQuotedString | An output argument containing the extracted string. |
Returns: The number of characters consumed from the buffer.
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.
Parameter | Description |
---|---|
aBuffer | The buffer containing the quoted. |
aQuotedString | An output argument containing the extracted string. |
Returns: The number of characters consumed from the buffer.
IMPORT_C TInt | RemoveWhiteSpace | ( | TPtrC8 & | aData, |
TRemoveMode | aMode | |||
) | [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).
Parameter | Description |
---|---|
aData | A descriptor pointer with the data. |
aMode | The specified removal mode. |
Returns: The number of consumed whitespace characters. If the data is empty or the data is all whitespace the error code KUriUtilsErrEmptyData is returned.
IMPORT_C TInt | RemoveWhiteSpace | ( | TPtrC16 & | aData, |
TRemoveMode | aMode | |||
) | [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).
Parameter | Description |
---|---|
aData | A descriptor pointer with the data. |
aMode | The specified removal mode. |
Returns: The number of consumed whitespace characters. If the data is empty or the data is all whitespace the error code KUriUtilsErrEmptyData is returned.