PbkEngUtils Struct Reference
Public Member Functions |
---|
IMPORT_C HBufC * | AllocL(HBufC *, TInt) |
IMPORT_C TInt | AppendAndReplaceChars(TDes &, const TDesC &, const TDesC &, const TDesC &) |
IMPORT_C void | AppendGraphicCharacters(TDes &, const TDesC &, TText) |
IMPORT_C MDesCArray * | BreakInWordsLC(const TDesC &, TIsWordSeparator) |
IMPORT_C TBool | ContainSameDigits(const TDesC &, const TDesC &, TInt) |
IMPORT_C TInt | CopyDigitsFromEnd(const TDesC &, TInt, TDes &) |
IMPORT_C HBufC * | CopyL(HBufC *, const TDesC &, TInt) |
IMPORT_C TInt | CountSpaces(const TDesC &) |
IMPORT_C void | FindAndOpenDefaultResourceFileLC(RFs &, RResourceFile &) |
IMPORT_C void | FindAndOpenResourceFileLC(RFs &, const TDesC &, const TDesC &, const TDesC &, RResourceFile &) |
TBool
| IsEmptyOrAllSpaces(const TDesC &) |
IMPORT_C void | ReplaceNonGraphicCharacters(TDes &, TText) |
IMPORT_C TInt | TrimAllAppend(const TDesC &, TDes &) |
IMPORT_C TInt | TrimAllLength(const TDesC &) |
IMPORT_C TInt | TrimRightAppend(const TDesC &, TDes &) |
IMPORT_C TInt | TrimRightLength(const TDesC &) |
Constructor & Destructor Documentation
PbkEngUtils()
Hidden, unimplemented constructor.
Member Functions Documentation
AllocL(HBufC *, TInt)
Allocates or reallocates aBuffer to be able to hold at least aMaxLength characters.
Parameters
HBufC * aBuffer | buffer to (re)allocate. Can be NULL. |
TInt aMaxLength | size for the buffer in characters |
AppendAndReplaceChars(TDes &, const TDesC &, const TDesC &, const TDesC &)
IMPORT_C TInt | AppendAndReplaceChars | ( | TDes & | aDest, |
| const TDesC & | aSrc, |
| const TDesC & | aCharsToReplace, |
| const TDesC & | aReplaceChars |
| ) | [static] |
Appends a descriptor to another and replaces characters while appending.
Parameters
TDes & aDest | destination descriptor. |
const TDesC & aSrc | source descriptor. |
const TDesC & aCharsToReplace | characters to replace from aSrc. |
const TDesC & aReplaceChars | characters to replace to from the same position in aCharsToReplace. |
AppendGraphicCharacters(TDes &, const TDesC &, TText)
IMPORT_C void | AppendGraphicCharacters | ( | TDes & | aDest, |
| const TDesC & | aSrc, |
| TText | aChar |
| ) | [static] |
Appends all graphic characters (TChar::IsGraph()) in a string to another string. Non-graphic characters are replaced with a specified character.
Parameters
TDes & aDest | the string where to append graphic characters. |
const TDesC & aSrc | the string where from chracters are appended to aDest. |
TText aChar | the character used to replace non-graphic characters in aSrc. |
BreakInWordsLC(const TDesC &, TIsWordSeparator)
IMPORT_C MDesCArray * | BreakInWordsLC | ( | const TDesC & | aText, |
| TIsWordSeparator | aWordSeparatorFunc = NULL |
| ) | [static] |
Breaks text into words array.
Parameters
const TDesC & aText | text to break into words. |
TIsWordSeparator aWordSeparatorFunc = NULL | function for detecting word separator characters. Default implementation uses TChar::IsSpace(). |
ContainSameDigits(const TDesC &, const TDesC &, TInt)
IMPORT_C TBool | ContainSameDigits | ( | const TDesC & | aNumText1, |
| const TDesC & | aNumText2, |
| TInt | aNumberOfDigits = 0 |
| ) | [static] |
Returns true if two descriptors contain the same digits in the same order. Skips all non-digit characters when doing the comparison.
Boundary conditions:
if both descriptors are empty the result is true
if both descriptors contain no digits the result is true
if both descriptors contain digits, but the other less than aNumberOfDigits the result is false
if both descriptors contain digits, but the other less than aNumberOfDigits the result is false
if both descriptors contain the same digits in the same order the result is always true regardless of the value of aNumberOfDigits
Parameters
const TDesC & aNumText1 | first descriptor to compare. |
const TDesC & aNumText2 | second descriptor to compare. |
TInt aNumberOfDigits = 0 | number of digits to compare from the end of the descriptors, if 0 all digits in both descriptors are compared. |
CopyDigitsFromEnd(const TDesC &, TInt, TDes &)
IMPORT_C TInt | CopyDigitsFromEnd | ( | const TDesC & | aNumText, |
| TInt | aNumberOfDigits, |
| TDes & | aDigitsText |
| ) | [static] |
Copies specified number of digit characters (c is a digit if TChar(c).IsDigit() is true) from the end of a descriptor to another descriptor. Used in phone number matching.
Parameters
const TDesC & aNumText | the text containing digits to copy, (i.e. a phone number). |
TInt aNumberOfDigits | maximum number of digits to copy. |
TDes & aDigitsText | descriptor where digits are copied. |
CopyL(HBufC *, const TDesC &, TInt)
Copies aText into aBuffer. The buffer is reallocated if necessary.
Parameters
HBufC * aBuffer | the buffer where to copy aText. Can be NULL. |
const TDesC & aText | text to be copied into aBuffer. |
TInt aMinBufLength = 0 | minimum length to allocate for aBuffer. |
CountSpaces(const TDesC &)
IMPORT_C TInt | CountSpaces | ( | const TDesC & | aText | ) | [static] |
Returns the number of white space characters in aText.
FindAndOpenDefaultResourceFileLC(RFs &, RResourceFile &)
IMPORT_C void | FindAndOpenDefaultResourceFileLC | ( | RFs & | aFs, |
| RResourceFile & | aResFile |
| ) | [static] |
Parameters
RFs & aFs | open file server handle. |
RResourceFile & aResFile | resource file to open. If open is succesful, resource file close operation is pushed on to the cleanup stack. |
FindAndOpenResourceFileLC(RFs &, const TDesC &, const TDesC &, const TDesC &, RResourceFile &)
IMPORT_C void | FindAndOpenResourceFileLC | ( | RFs & | aFs, |
| const TDesC & | aResFileName, |
| const TDesC & | aResFilePath, |
| const TDesC & | aResFileDrive, |
| RResourceFile & | aResFile |
| ) | [static] |
Searches and opens a resource file.
- Exceptions
-
KErrNoMemory |
if out of memory.
|
KErrNotFound |
if the resource file is not found.
|
KErrBadName |
if an empty file name (with path) was supplied
|
other |
error searching or opening the resource file.
|
Parameters
RFs & aFs | open file server handle. |
const TDesC & aResFileName | resource file name. |
const TDesC & aResFilePath | path to search the resource file from. |
const TDesC & aResFileDrive | Drive the resource file is on. |
RResourceFile & aResFile | resource file to open. If open is succesful, resource file close operation is pushed on to the cleanup stack. |
IsEmptyOrAllSpaces(const TDesC &)
TBool
| IsEmptyOrAllSpaces | ( | const TDesC & | aText | ) | [static, inline] |
Returns ETrue if aText is either empty or consists of only white space characters.
ReplaceNonGraphicCharacters(TDes &, TText)
IMPORT_C void | ReplaceNonGraphicCharacters | ( | TDes & | aText, |
| TText | aChar |
| ) | [static] |
Replaces all non-graphic characters (!TCharIsGraph()) in a string with the specified character.
Parameters
TDes & aText | the string where to replace non-graphics characters. |
TText aChar | the character used to replace non-graphic characters in aText. |
TrimAllAppend(const TDesC &, TDes &)
IMPORT_C TInt | TrimAllAppend | ( | const TDesC & | aText, |
| TDes & | aDest |
| ) | [static] |
Appends aText to aDest. Ignores all leading and trailing spaces in aText and converts consencutive space characters to a single space character.
Parameters
const TDesC & aText | text to append as a trimmed version to aDest. |
TDes & aDest | buffer where trimmed aText is appended. aDest must have enough room for the copied text. |
TrimAllLength(const TDesC &)
IMPORT_C TInt | TrimAllLength | ( | const TDesC & | aText | ) | [static] |
Calculates and returns the trimmed length of aText. Ignores all leading and trailing spaces in aText and calculates consencutive space characters as a single character.
Parameters
const TDesC & aText | the text whose trimmed length is to be calculated. |
TrimRightAppend(const TDesC &, TDes &)
IMPORT_C TInt | TrimRightAppend | ( | const TDesC & | aText, |
| TDes & | aDest |
| ) | [static] |
Appends aText to aDest. Ignores all trailing spaces in aText and converts consencutive space characters to a single space character. Leading spaces remain unaffected.
Parameters
const TDesC & aText | text to append as a trimmed version to aDest. |
TDes & aDest | buffer where trimmed aText is appended. aDest must have enough room for the copied text. |
TrimRightLength(const TDesC &)
IMPORT_C TInt | TrimRightLength | ( | const TDesC & | aText | ) | [static] |
Calculates and returns the trimmed length of aText. Ignores all trailing spaces in aText and calculates consencutive space characters as a single character. Leading spaces remain unaffected.
Parameters
const TDesC & aText | the text whose trimmed length is to be calculated. |
Member Type Definitions Documentation
Typedef TIsWordSeparator
typedef
TBool(* | TIsWordSeparator |
Definition for a function that returns true if aChar is a word separator character. BreakInWordsL
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.