DynamicRest.JsonReader.ReadName C# (CSharp) Method

ReadName() private method

private ReadName ( bool allowQuotes ) : string
allowQuotes bool
return string
        private string ReadName(bool allowQuotes)
        {
            char ch = PeekNextSignificantCharacter();

            if ((ch == '"') || (ch == '\'')) {
                if (allowQuotes) {
                    return ReadString();
                }
            }
            else {
                StringBuilder sb = new StringBuilder();

                while (true) {
                    ch = (char)_reader.Peek();
                    if ((ch == '_') || Char.IsLetterOrDigit(ch)) {
                        _reader.Read();
                        sb.Append(ch);
                    }
                    else {
                        return sb.ToString();
                    }
                }
            }

            return null;
        }