Lines Matching defs:state
47 /// An opaque struct that represents the current parsing state and is passed along
59 internal ParserInternalState state;
62 internal static void Initialize(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state, out ParseContext ctx)
65 ctx.state = state;
70 /// WARNING: internally this copies the CodedInputStream's state, so after done with the ParseContext,
71 /// the CodedInputStream's state needs to be updated.
77 // ideally we would use a reference to the original state, but that doesn't seem possible
78 // so we just copy the struct that holds the state. We will need to later store the state back
80 ctx.state = input.InternalState;
93 ctx.state = default;
94 ctx.state.lastTag = 0;
95 ctx.state.recursionDepth = 0;
96 ctx.state.sizeLimit = DefaultSizeLimit;
97 ctx.state.recursionLimit = recursionLimit;
98 ctx.state.currentLimit = int.MaxValue;
99 SegmentedBufferHelper.Initialize(input, out ctx.state.segmentedBufferHelper, out ctx.buffer);
100 ctx.state.bufferPos = 0;
101 ctx.state.bufferSize = ctx.buffer.Length;
103 ctx.state.DiscardUnknownFields = false;
104 ctx.state.ExtensionRegistry = null;
111 internal uint LastTag { get { return state.lastTag; } }
117 get { return state.DiscardUnknownFields; }
118 set { state.DiscardUnknownFields = value; }
126 get { return state.ExtensionRegistry; }
127 set { state.ExtensionRegistry = value; }
142 return ParsingPrimitives.ParseTag(ref buffer, ref state);
151 return ParsingPrimitives.ParseDouble(ref buffer, ref state);
160 return ParsingPrimitives.ParseFloat(ref buffer, ref state);
169 return ParsingPrimitives.ParseRawVarint64(ref buffer, ref state);
178 return (long)ParsingPrimitives.ParseRawVarint64(ref buffer, ref state);
187 return (int)ParsingPrimitives.ParseRawVarint32(ref buffer, ref state);
196 return ParsingPrimitives.ParseRawLittleEndian64(ref buffer, ref state);
205 return ParsingPrimitives.ParseRawLittleEndian32(ref buffer, ref state);
214 return ParsingPrimitives.ParseRawVarint64(ref buffer, ref state) != 0;
222 return ParsingPrimitives.ReadString(ref buffer, ref state);
249 return ParsingPrimitives.ReadBytes(ref buffer, ref state);
257 return ParsingPrimitives.ParseRawVarint32(ref buffer, ref state);
267 return (int)ParsingPrimitives.ParseRawVarint32(ref buffer, ref state);
276 return (int)ParsingPrimitives.ParseRawLittleEndian32(ref buffer, ref state);
285 return (long)ParsingPrimitives.ParseRawLittleEndian64(ref buffer, ref state);
294 return ParsingPrimitives.DecodeZigZag32(ParsingPrimitives.ParseRawVarint32(ref buffer, ref state));
303 return ParsingPrimitives.DecodeZigZag64(ParsingPrimitives.ParseRawVarint64(ref buffer, ref state));
316 return (int)ParsingPrimitives.ParseRawVarint32(ref buffer, ref state);
321 input.InternalState = state;
326 state = input.InternalState;