MapAround.IO.WktStreamTokenizer.ReadToken C# (CSharp) Method

ReadToken() private method

Reads a token and checks whether it corresponds the specified token.
private ReadToken ( string expectedToken ) : void
expectedToken string An expected token
return void
        internal void ReadToken(string expectedToken)
        {
            this.NextToken();
            if (this.GetStringValue() != expectedToken)
                throw new ArgumentException(String.Format(CultureInfo.InvariantCulture.NumberFormat, "Expected ('{3}'), but goes '{0}'. Line {1}, position {2}.", this.GetStringValue(), this.LineNumber, this.Column, expectedToken));
        }

Usage Example

コード例 #1
0
 private static Polyline readMultiLineString(WktStreamTokenizer tokenizer)
 {
     tokenizer.ReadToken("(");
     List<List<ICoordinate>> lists = readPointsCoordLists(tokenizer);
     if (tokenizer.GetStringValue() == ")")
     {
         Polyline polyline = new Polyline();
         foreach (List<ICoordinate> list in lists)
         {
             LinePath path = new LinePath();
             path.Vertices = list;
             polyline.Paths.Add(path);
         }
         return polyline;
     }
     else 
         throwMissingCloseBracket(tokenizer);
     return null;
 }
All Usage Examples Of MapAround.IO.WktStreamTokenizer::ReadToken