Index: src/Common/SharpMap/Converters/WellKnownText/WKTStreamTokenizer.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/Common/SharpMap/Converters/WellKnownText/WKTStreamTokenizer.cs (.../WKTStreamTokenizer.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/Common/SharpMap/Converters/WellKnownText/WKTStreamTokenizer.cs (.../WKTStreamTokenizer.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -45,80 +45,82 @@ namespace SharpMap.Converters.WellKnownText { - /// - /// Reads a stream of Well Known Text (wkt) string and returns a stream of tokens. - /// - internal class WktStreamTokenizer : StreamTokenizer - { + /// + /// Reads a stream of Well Known Text (wkt) string and returns a stream of tokens. + /// + internal class WktStreamTokenizer : StreamTokenizer + { + #region Constructors - #region Constructors + /// + /// Initializes a new instance of the WktStreamTokenizer class. + /// + /// The WktStreamTokenizer class ais in reading WKT streams. + /// A TextReader that contains + public WktStreamTokenizer(TextReader reader) : base(reader, true) + { + if (reader == null) + { + throw new ArgumentNullException("reader"); + } + } - /// - /// Initializes a new instance of the WktStreamTokenizer class. - /// - /// The WktStreamTokenizer class ais in reading WKT streams. - /// A TextReader that contains - public WktStreamTokenizer(TextReader reader) : base(reader, true) - { - if (reader==null) - { - throw new ArgumentNullException("reader"); - } - } - #endregion + #endregion - #region Methods + #region Methods - /// - /// Reads a token and checks it is what is expected. - /// - /// The expected token. - internal void ReadToken(string expectedToken) - { - this.NextToken(); - if (this.GetStringValue()!=expectedToken) - { - throw new Exception(String.Format(SharpMap.Map.numberFormat_EnUS, "Expecting ('{3}') but got a '{0}' at line {1} column {2}.", this.GetStringValue(), this.LineNumber, this.Column, expectedToken)); - } - } - - /// - /// Reads a string inside double quotes. - /// - /// - /// White space inside quotes is preserved. - /// - /// The string inside the double quotes. - public string ReadDoubleQuotedWord() - { - string word=""; - ReadToken("\""); - NextToken(false); - while (GetStringValue()!="\"") - { - word = word+ this.GetStringValue(); - NextToken(false); - } - return word; - } + /// + /// Reads a token and checks it is what is expected. + /// + /// The expected token. + internal void ReadToken(string expectedToken) + { + NextToken(); + if (GetStringValue() != expectedToken) + { + throw new Exception(String.Format(Map.numberFormat_EnUS, "Expecting ('{3}') but got a '{0}' at line {1} column {2}.", GetStringValue(), LineNumber, Column, expectedToken)); + } + } - /// - /// Reads the authority and authority code. - /// - /// String to place the authority in. - /// String to place the authority code in. - public void ReadAuthority(ref string authority,ref long authorityCode) - { - //AUTHORITY["EPGS","9102"]] - if(GetStringValue() != "AUTHORITY") - ReadToken("AUTHORITY"); - ReadToken("["); - authority = this.ReadDoubleQuotedWord(); - ReadToken(","); - long.TryParse(this.ReadDoubleQuotedWord(),out authorityCode); - ReadToken("]"); - } - #endregion + /// + /// Reads a string inside double quotes. + /// + /// + /// White space inside quotes is preserved. + /// + /// The string inside the double quotes. + public string ReadDoubleQuotedWord() + { + string word = ""; + ReadToken("\""); + NextToken(false); + while (GetStringValue() != "\"") + { + word = word + GetStringValue(); + NextToken(false); + } + return word; + } - } -} + /// + /// Reads the authority and authority code. + /// + /// String to place the authority in. + /// String to place the authority code in. + public void ReadAuthority(ref string authority, ref long authorityCode) + { + //AUTHORITY["EPGS","9102"]] + if (GetStringValue() != "AUTHORITY") + { + ReadToken("AUTHORITY"); + } + ReadToken("["); + authority = ReadDoubleQuotedWord(); + ReadToken(","); + long.TryParse(ReadDoubleQuotedWord(), out authorityCode); + ReadToken("]"); + } + + #endregion + } +} \ No newline at end of file