ReadNextChar() public method

public ReadNextChar ( ) : char
return char
示例#1
0
        public CqlType CreateType(TypeParser parser)
        {
            string keyspace = parser.ReadNextIdentifier();
            parser.SkipBlankAndComma();
            string name = parser.ReadNextIdentifier().DecodeHex();

            var fieldNames = new List<string>();
            var fieldTypes = new List<CqlType>();

            while(parser.SkipBlankAndComma())
            {
                if(parser.Peek() == ')')
                    return CreateTypeInternal(keyspace, name, fieldNames, fieldTypes, null);

                string fieldName = parser.ReadNextIdentifier().DecodeHex();

                if(parser.ReadNextChar() != ':')
                    throw new CqlException("Error parsing UserType arguments: ':' expected after fieldName.");

                CqlType type = parser.ReadCqlType();

                fieldNames.Add(fieldName);
                fieldTypes.Add(type);
            }

            throw new CqlException("Error parsing UserType arguments: unexpected end of string.");
        }
示例#2
0
        public CqlType CreateType(TypeParser parser)
        {
            var keyType = parser.ReadCqlType();

            if(parser.ReadNextChar() != ',')
                throw new CqlException("Expected a ',' during parsing of a map type");

            var valueType = parser.ReadCqlType();

            return CreateType(keyType, valueType);
        }