ProtocolBuffers.TokenReader.ReadNextOrThrow C# (CSharp) Метод

ReadNextOrThrow() публичный Метод

Read next token and throw a ProtoFormatException if the token was not the specified.
public ReadNextOrThrow ( string expect ) : void
expect string
Результат void
        public void ReadNextOrThrow(string expect)
        {
            string n = ReadNext ();
            if (n != expect)
                throw new ProtoFormatException ("Expected: " + expect + " got " + n);
        }

Usage Example

Пример #1
0
        static Message ParseMessage(TokenReader tr, Message parent)
        {
            Message msg = new Message (parent);
            msg.Comments = lastComment;
            lastComment = null;
            msg.ProtoName = tr.ReadNext ();

            tr.ReadNextOrThrow ("{");

            while (ParseField (tr, msg))
                continue;

            return msg;
        }
All Usage Examples Of ProtocolBuffers.TokenReader::ReadNextOrThrow