Class WktShapeParser.State
The parse state.
Inheritance
Inherited Members
Assembly: Spatial4n.dll
Syntax
[Serializable]
public class State
Constructors
Name | Description |
---|---|
State(WktShapeParser, String) |
Fields
Name | Description |
---|---|
dimension | Dimensionality specifier (e.g. 'Z', or 'M') following a shape type name. |
offset | Offset of the next char in rawString to be read. |
rawString | Set in ParseIfSupported(String). |
Properties
Name | Description |
---|---|
Ctx | |
Eof | If the string is consumed, i.e. at end-of-file. |
Parser |
Methods
Name | Description |
---|---|
NextDouble() | Reads in a double from the string. Parses digits with an optional decimal, sign, or exponent. NaN and Infinity are not supported. offset is advanced past whitespace. |
NextExpect(Char) | Verifies that the current character is of the expected value. If the character is the expected value, then it is consumed and offset is advanced past whitespace. |
NextIf(Char) | If the current character is |
NextIfEmptyAndSkipZM() | Skips over a dimensionality token (e.g. 'Z' or 'M') if found, storing in dimension, and then looks for EMPTY, consuming that and whitespace.
|
NextIfWhitespace() | Moves offset to next non-whitespace character. Doesn't move if the offset is already at
non-whitespace. |
NextSubShapeString() | Returns the next chunk of text till the next ',' or ')' (non-inclusive) or EOF. If a '(' is encountered, then it looks past its matching ')', taking care to handle nested matching parenthesis too. It's designed to be of use to subclasses that wish to get the entire subshape at the current position as a string so that it might be passed to other software that will parse it. Example:
If this is called when offset is at the first character, then it will return this whole string. If called at the "I" then it will return "INNER(3, 5)". If called at "3", then it will return "3". In all cases, offset will be positioned at the next position following the returned substring. |
NextWord() | Reads the word starting at the current character position. The word
terminates once Spatial4n.Core.IO.WktShapeParser.State.IsIdentifierPartCharacter(System.Char) (which is identical to Java's |
SkipDouble() | Advances offset forward until it points to a character that isn't part of a number. |
SkipNextDoubles() | Advances past as many doubles as there are, with intervening whitespace. |