Lines Matching defs:value
248 var value = ParseSingleValue(field, tokenizer);
249 field.Accessor.SetValue(message, value);
258 throw new InvalidProtocolBufferException("Repeated field value was not an array. Token type: " + token.Type);
270 object value = ParseSingleValue(field, tokenizer);
271 if (value == null)
275 list.Add(value);
305 object value = ParseSingleValue(valueField, tokenizer);
306 if (value == null)
310 dictionary[key] = value;
356 // TODO: Merge the current value in message? (Public API currently doesn't make this relevant as we don't expose merging.)
377 // Note: not passing the number value itself here, as we may end up storing the string value in the token too.
492 throw new InvalidProtocolBufferException("Expected object value for Struct");
502 // Record the token stream until we see the @type property. At that point, we can take the value, consult
509 throw new InvalidProtocolBufferException("Expected object value for Any");
528 // Don't add the @type property or its value to the recorded token list
532 throw new InvalidProtocolBufferException("Expected string value for Any.@type");
562 // Well-known types end up in a property called "value" in the JSON. As there's no longer a @type property
563 // in the given JSON token stream, we should *only* have tokens of start-object, name("value"), the value
578 throw new InvalidProtocolBufferException($"Expected end-object token after @type/value for well-known type");
620 double value = token.NumberValue;
630 CheckInteger(value);
631 return (int) value;
634 CheckInteger(value);
635 return (uint) value;
639 CheckInteger(value);
640 return (long) value;
643 CheckInteger(value);
644 return (ulong) value;
646 return value;
648 if (double.IsNaN(value))
652 if (value > float.MaxValue || value < float.MinValue)
654 if (double.IsPositiveInfinity(value))
658 if (double.IsNegativeInfinity(value))
662 throw new InvalidProtocolBufferException($"Value out of range: {value}");
664 return (float) value;
666 CheckInteger(value);
668 // Note that we deliberately don't check that it's a known value.
669 return (int) value;
676 throw new InvalidProtocolBufferException($"Value out of range: {value}");
681 private static void CheckInteger(double value)
683 if (double.IsInfinity(value) || double.IsNaN(value))
685 throw new InvalidProtocolBufferException($"Value not an integer: {value}");
687 if (value != Math.Floor(value))
689 throw new InvalidProtocolBufferException($"Value not an integer: {value}");
734 throw new InvalidProtocolBufferException($"Invalid enum value: {text} for enum type: {field.EnumType.FullName}");
756 throw new InvalidProtocolBufferException($"Invalid numeric value: {text}");
762 throw new InvalidProtocolBufferException($"Invalid numeric value: {text}");
769 throw new InvalidProtocolBufferException($"Invalid numeric value: {text}");
778 throw new InvalidProtocolBufferException($"Invalid numeric value for type: {text}");
797 throw new InvalidProtocolBufferException($"Invalid numeric value: {text}");
805 throw new InvalidProtocolBufferException("Expected string value for Timestamp");
810 throw new InvalidProtocolBufferException($"Invalid Timestamp value: {token.StringValue}");
842 throw new InvalidProtocolBufferException("Invalid Timestamp value: " + token.StringValue);
847 throw new InvalidProtocolBufferException("Invalid Timestamp value: " + token.StringValue);
865 throw new InvalidProtocolBufferException("Invalid Timestamp value: " + token.StringValue);
873 throw new InvalidProtocolBufferException("Invalid Timestamp value: " + token.StringValue);
881 throw new InvalidProtocolBufferException("Expected string value for Duration");
886 throw new InvalidProtocolBufferException("Invalid Duration value: " + token.StringValue);
893 throw new InvalidProtocolBufferException("Invalid Duration value: " + token.StringValue);
910 throw new InvalidProtocolBufferException($"Invalid Duration value: {token.StringValue}");
917 throw new InvalidProtocolBufferException($"Invalid Duration value: {token.StringValue}");
925 throw new InvalidProtocolBufferException("Expected string value for FieldMask");