class STParserOps
|
Functionality to parse strings in to usable parts.
More... |
|
|
Public Methods
- QString RemoveFrontAndBackChars (QString &TextString, QString &TheChar)
- bool WildCardCompairStrings (QString &CompairString1,QString &CompairString2, bool CaseSensitive)
- QString ExtractWord (QString &SourceString, int WordIndex)
- QString RemoveWord (QString &SourceString, int WordIndex)
- QString TrucateUpToWord (QString &SourceString, int WordIndex)
- QString TrucateAfterWord (QString &SourceString, int WordIndex)
- QString FindFirstWord (QString &SourceString)
- QString FindNextWord (QString &SourceString, uint WordIndex)
- QString FindFirstIdentifier (QString &SourceString)
- QString FindNextIdentifier (QString &SourceString, uint IdentifierIndex)
- bool IsAlpha (char TheChar)
- bool IsNumber (char TheChar)
- bool IsSymbole (char TheChar)
- QString ExtractBlock (QString &SourceString, int BlockIndex, QString &BlockIndicators)
- QString RemoveBlock (QString &SourceString, int BlockIndex, QString &BlockIndicators)
- QString ExtractNumberString (QString &SourceString, int WordIndex)
- STParserOps ()
- ~STParserOps ()
Functionality to parse strings in to usable parts. Parts are defined as words and blocks.
Words: A word is a block of text that is holely alphabetic.
For example " this is four words " "(this is three)" " this twoWords " " this is 2 "
Identifier: An identifier is a block of text that is holely alpha-numeric and not starting with a number.
For example " this_is_an_Identifier " "(this_is_an_Identifier)"
" this_is two_Identifiers " " this_is_2 Identifiers " " this_is 1_Identifier "
These would be similar to names in C and C++ for varibles and function names.
Blocks: A block is any amount of text containing alpha, numerics or symbols that is preseeded by a
block identifier and followed by a block identifier. In C "{" and "}" are block identifiers. The text
code between them is the block.
QString RemoveFrontAndBackChars (QString &TextString, QString &TheChar)
| RemoveFrontAndBackChars |
Strip unwanted chars off the front and back of a string.
bool WildCardCompairStrings (QString &CompairString1,QString &CompairString2, bool CaseSensitive)
| WildCardCompairStrings |
Compairs two strings, one containing wild cards of * or ? for
sections of any thing any length represented by a * or and single
char represented by ?.
QString ExtractWord (QString &SourceString, int WordIndex)
| ExtractWord |
From a given string this function will return the word that is WordIndex
counts in from the begining.
QString RemoveWord (QString &SourceString, int WordIndex)
| RemoveWord |
From a given string this function will return the entire string except the
word that is WordIndex counts in from the begining.
QString TrucateUpToWord (QString &SourceString, int WordIndex)
| TrucateUpToWord |
From a given string this function will return a string with
every thing from the word at WordIndex counts from the begining to the end.
QString TrucateAfterWord (QString &SourceString, int WordIndex)
| TrucateAfterWord |
From a given string this function will return a string with
every thing from begining untill the word at WordIndex counts from the begining.
QString FindFirstWord (QString &SourceString)
| FindFirstWord |
From a given string this function will return a string that is the first word in the string.
QString FindNextWord (QString &SourceString, uint WordIndex)
| FindNextWord |
From a given string this function will return a string that is the next word
after the word at WordIndex.
QString FindFirstIdentifier (QString &SourceString)
| FindFirstIdentifier |
From a given string this function will return a string that is the
first identifier in the string.
QString FindNextIdentifier (QString &SourceString, uint IdentifierIndex)
| FindNextIdentifier |
From a given string this function will return a string that is the next
identifier after the identifier at IdentifierIndex.
bool IsAlpha (char TheChar)
| IsAlpha |
Used internaly mostly to find if a given char is alpha.
bool IsNumber (char TheChar)
| IsNumber |
Used internaly mostly to find if a given char is an ASCII number.
bool IsSymbole (char TheChar)
| IsSymbole |
Used internaly mostly to find if a given char is a symbol.
QString ExtractBlock (QString &SourceString, int BlockIndex, QString &BlockIndicators)
| ExtractBlock |
From a given string this function will return the block that is BlockIndex
counts in from the begining.
QString RemoveBlock (QString &SourceString, int BlockIndex, QString &BlockIndicators)
| RemoveBlock |
From a given string this function will return the entire string except the
block that is BlockIndex counts in from the begining.
QString ExtractNumberString (QString &SourceString, int WordIndex)
| ExtractNumberString |
This function will attempt to extract a number string from the midle of
a give string. Any symbols like $ % or # and so on will be truncated. If more
then one number is found in the string then the function will keep looking for
whole numbers until it reaches WordIndex counts of numbers found. The decimal
number symbol in a number like 6.43 will be included in the returned string
so that floating point numbers can be grabed.
STParserOps ()
| STParserOps |
Constructor
~STParserOps ()
| ~STParserOps |
Destructor
Generated by: root on UtopiaPlanitia.Ept on Mon Dec 10 22:55:12 2001, using kdoc 2.0a53. |