Parsig data from character arrays. Provides various parsing and writing utilities on character buffers. $A Igor Feb09;
More...
|
| StringParser () |
|
| StringParser (String str) |
|
| StringParser (StringBuilder sb) |
|
void | EnsureCapacity (int capacity) |
| Ensures that the buffer has at least the specified capacity. More...
|
|
void | AddEscapeSequence (char code, char character) |
| Adds a new escape sequence definition to the parser. More...
|
|
void | RemoveEscapeSequence (char code, char character) |
| Removes the specified escape sequence from the parser. More...
|
|
void | AddCharacterReferences (string code, char character) |
| Adds a new character reference definition to the parser. More...
|
|
void | RemoveEscapeSequence (string code, char character) |
| Removes the specified character reference from the parser. More...
|
|
int | getChar (int from, int to, bool useEscape, ref char value) |
| Returns position rightr after the character that resides at position from and the value of that character as output argument. If the character can not be obtained (e.g. because of overflow, etc.), -1 is returned. More...
|
|
int | getPosAfterExponent (int startPos) |
|
bool | isSpace (char c) |
| Whether the specified character represents a space for the current parser. More...
|
|
bool | isOpenBracket (char c) |
| Whether the specified character represents an open bracket for the current parser. More...
|
|
void | Set (String str) |
|
void | Set (StringBuilder sb) |
|
|
void | initEscapeSequences () |
| Initializes data structures used for escape sequences. More...
|
|
void | initCharacterReferences () |
| Initializes data structures used for character references. More...
|
|
int | getCharFromReferenceNoCheck (int from, int to, ref char value) |
| Gets a character represented by a character reference at the specified position. If character references are not defined on the current parser. WARNING: Does not check consistency of input parameters! More...
|
|
int | getCharFromEscapeNoCheck (int from, int to, ref char value) |
| Gets a character represented by an escape sequence at the specified position. If character references are not defined on the current parser. Does not check input parameters, tries to convert an escape sequence to character even if internal parameters specify that there are no escape sequences. TODO: implement this method! More...
|
|
bool | isCloseBracket (char c) |
| Whether the specified character represents a closed bracket for the current parser. More...
|
|
int | bracketIndex (char c) |
| Index of the specified character among open or closed brackets, or 0 if the character does not represent neither open nor closed bracket. More...
|
|
|
ICharacterBuffer | Buffer [get, set] |
|
object | Lock [get] |
| This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. More...
|
|
object | InternalLock [get] |
| Used internally for locking access to internal fields. More...
|
|
int | Position [get, set] |
| Current position. More...
|
|
int | Length [get] |
| Current length of the buffer. More...
|
|
virtual Boolean | UseThousandSeparator [get, protected set] |
|
virtual char | EscapeCharacter [get, protected set] |
| Returns the escape character of the current string parser. More...
|
|
bool | UseEscapeSeuences [get, set] |
| Whether or not escape characters are used. Evaluates to true only if the appropriate flag is set and also any escape seuences are defined (setter just sets the flag). With escape characters, a combination of the escape character and another character substitutes a special character. More...
|
|
bool | UseCharacterReferences [get, set] |
| Whether or not character references are used. Evaluates to true only if the appropriate flag is set and also any character replacements are defined (setter just sets the flag). With escape characters, a combination of the escape character and another character substitutes a special character. More...
|
|
bool | UseCharacterReplacement [get] |
|
static StringParser | Global [get] |
|
Parsig data from character arrays. Provides various parsing and writing utilities on character buffers. $A Igor Feb09;
IG.Lib.StringParser.StringParser |
( |
| ) |
|
|
inline |
IG.Lib.StringParser.StringParser |
( |
String |
str | ) |
|
|
inline |
IG.Lib.StringParser.StringParser |
( |
StringBuilder |
sb | ) |
|
|
inline |
void IG.Lib.StringParser.EnsureCapacity |
( |
int |
capacity | ) |
|
|
inline |
Ensures that the buffer has at least the specified capacity.
- Parameters
-
void IG.Lib.StringParser.initEscapeSequences |
( |
| ) |
|
|
inlineprotected |
Initializes data structures used for escape sequences.
void IG.Lib.StringParser.AddEscapeSequence |
( |
char |
code, |
|
|
char |
character |
|
) |
| |
|
inline |
Adds a new escape sequence definition to the parser.
void IG.Lib.StringParser.RemoveEscapeSequence |
( |
char |
code, |
|
|
char |
character |
|
) |
| |
|
inline |
Removes the specified escape sequence from the parser.
void IG.Lib.StringParser.initCharacterReferences |
( |
| ) |
|
|
inlineprotected |
Initializes data structures used for character references.
void IG.Lib.StringParser.AddCharacterReferences |
( |
string |
code, |
|
|
char |
character |
|
) |
| |
|
inline |
Adds a new character reference definition to the parser.
void IG.Lib.StringParser.RemoveEscapeSequence |
( |
string |
code, |
|
|
char |
character |
|
) |
| |
|
inline |
Removes the specified character reference from the parser.
int IG.Lib.StringParser.getCharFromReferenceNoCheck |
( |
int |
from, |
|
|
int |
to, |
|
|
ref char |
value |
|
) |
| |
|
inlineprotected |
Gets a character represented by a character reference at the specified position. If character references are not defined on the current parser. WARNING: Does not check consistency of input parameters!
- Parameters
-
from | Position at which character reference is obtained. |
to | Last position until which the character reference can last. |
value | Character represented by the character reference. |
- Returns
- Position right after the character reference, or -1 if not found.
int IG.Lib.StringParser.getCharFromEscapeNoCheck |
( |
int |
from, |
|
|
int |
to, |
|
|
ref char |
value |
|
) |
| |
|
inlineprotected |
Gets a character represented by an escape sequence at the specified position. If character references are not defined on the current parser. Does not check input parameters, tries to convert an escape sequence to character even if internal parameters specify that there are no escape sequences. TODO: implement this method!
- Parameters
-
from | Position at which character reference is obtained. |
to | Last position until which the character reference can last. |
value | Character represented by the character reference. |
- Returns
- Position right after the character reference, or -1 if not found.
int IG.Lib.StringParser.getChar |
( |
int |
from, |
|
|
int |
to, |
|
|
bool |
useEscape, |
|
|
ref char |
value |
|
) |
| |
|
inline |
Returns position rightr after the character that resides at position from and the value of that character as output argument. If the character can not be obtained (e.g. because of overflow, etc.), -1 is returned.
- Parameters
-
from | Position at which character is seen. |
to | Position until which (inclusively) character is parsed in case that character references or escape sequences are used. |
useEscape | Whether to use character replacement (escape sequences and character references). Whether the flag actually has effect depends also on internal settings of the string parser. |
value | Returns value of the character at the specified position (if a valid value can be obtained). |
- Returns
- Position of the first character after the obtained character.
int IG.Lib.StringParser.getPosAfterExponent |
( |
int |
startPos | ) |
|
|
inline |
bool IG.Lib.StringParser.isSpace |
( |
char |
c | ) |
|
|
inline |
Whether the specified character represents a space for the current parser.
bool IG.Lib.StringParser.isOpenBracket |
( |
char |
c | ) |
|
|
inline |
Whether the specified character represents an open bracket for the current parser.
bool IG.Lib.StringParser.isCloseBracket |
( |
char |
c | ) |
|
|
inlineprotected |
Whether the specified character represents a closed bracket for the current parser.
int IG.Lib.StringParser.bracketIndex |
( |
char |
c | ) |
|
|
inlineprotected |
Index of the specified character among open or closed brackets, or 0 if the character does not represent neither open nor closed bracket.
void IG.Lib.StringParser.Set |
( |
String |
str | ) |
|
|
inline |
void IG.Lib.StringParser.Set |
( |
StringBuilder |
sb | ) |
|
|
inline |
int IG.Lib.StringParser._pos = 0 |
|
protected |
object IG.Lib.StringParser._mainLock = new object() |
|
private |
object IG.Lib.StringParser._internalLock = new object() |
|
private |
List<char> IG.Lib.StringParser._spaces |
|
protected |
List<char> IG.Lib.StringParser._openBrackets |
|
protected |
List<char> IG.Lib.StringParser._closedBrackets |
|
protected |
char IG.Lib.StringParser._decimalPoint = '.' |
|
protected |
char IG.Lib.StringParser._thousandSeparator = ',' |
|
protected |
char [] IG.Lib.StringParser._expC = { 'e', 'E', 'g', 'G' } |
|
private |
String [] IG.Lib.StringParser._expS = {"*10^"} |
|
private |
List<char> IG.Lib.StringParser._exponentChars = null |
|
protected |
List<String> IG.Lib.StringParser._exponentStrings = null |
|
protected |
bool IG.Lib.StringParser._useEscapeSequences = false |
|
private |
bool IG.Lib.StringParser._useCharacterReferences = false |
|
private |
char IG.Lib.StringParser._escapeChar = '\\' |
|
protected |
List<KeyValueSortable<char, char> > IG.Lib.StringParser._escapeSequences |
|
protected |
List<KeyValueSortable<char, char> > IG.Lib.StringParser._inverseEscapeSequences |
|
protected |
List<KeyValueSortable<string, char> > IG.Lib.StringParser._characterReferences |
|
private |
List<KeyValueSortable<string, char> > IG.Lib.StringParser._inverseCharacterReferences |
|
private |
object IG.Lib.StringParser.Lock |
|
get |
This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock.
object IG.Lib.StringParser.InternalLock |
|
getprotected |
Used internally for locking access to internal fields.
int IG.Lib.StringParser.Position |
|
getset |
int IG.Lib.StringParser.Length |
|
get |
Current length of the buffer.
virtual Boolean IG.Lib.StringParser.UseThousandSeparator |
|
getprotected set |
virtual char IG.Lib.StringParser.EscapeCharacter |
|
getprotected set |
Returns the escape character of the current string parser.
bool IG.Lib.StringParser.UseEscapeSeuences |
|
getset |
Whether or not escape characters are used. Evaluates to true only if the appropriate flag is set and also any escape seuences are defined (setter just sets the flag). With escape characters, a combination of the escape character and another character substitutes a special character.
bool IG.Lib.StringParser.UseCharacterReferences |
|
getset |
Whether or not character references are used. Evaluates to true only if the appropriate flag is set and also any character replacements are defined (setter just sets the flag). With escape characters, a combination of the escape character and another character substitutes a special character.
bool IG.Lib.StringParser.UseCharacterReplacement |
|
get |
The documentation for this class was generated from the following file: