diff options
author | Jon Skeet <skeet@pobox.com> | 2015-06-11 21:15:36 +0100 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2015-06-11 21:15:36 +0100 |
commit | 39aaf21d5194fdc07c296847def8e7795279e041 (patch) | |
tree | 174c362717574e13047c4d590b5f9609405aed84 /csharp/src/ProtocolBuffers/ICodedInputStream.cs | |
parent | ce0e348ded9cb7e180588476ebb5a8f3e0460f4e (diff) | |
download | protobuf-39aaf21d5194fdc07c296847def8e7795279e041.tar.gz protobuf-39aaf21d5194fdc07c296847def8e7795279e041.tar.bz2 protobuf-39aaf21d5194fdc07c296847def8e7795279e041.zip |
Reimplement enums as int values, and get rid of EnumHelper.
This makes repeated fields really awkward at the moment - but when we reimplement RepeatedField<T> to be backed by an array, we can cast the array directly...
Diffstat (limited to 'csharp/src/ProtocolBuffers/ICodedInputStream.cs')
-rw-r--r-- | csharp/src/ProtocolBuffers/ICodedInputStream.cs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/csharp/src/ProtocolBuffers/ICodedInputStream.cs b/csharp/src/ProtocolBuffers/ICodedInputStream.cs index 748589a0..d962e62b 100644 --- a/csharp/src/ProtocolBuffers/ICodedInputStream.cs +++ b/csharp/src/ProtocolBuffers/ICodedInputStream.cs @@ -146,14 +146,11 @@ namespace Google.Protobuf bool ReadUInt32(ref uint value);
/// <summary>
- /// Reads an enum field value from the stream. If the enum is valid for type T,
- /// then the ref value is set and it returns true. Otherwise, if a value is present
- /// but invalid for the proto enum, it is still set in the field as a "preserved
- /// but invalid" value, and the method returns true. If no value can be read, the
- /// method does not affect the parameter and returns false.
+ /// Reads an enum field value from the stream. This performs no checking
+ /// as to whether the enum value is known to the enum type as it was present
+ /// when the code was generated.
/// </summary>
- bool ReadEnum<T>(ref T value)
- where T : struct, IComparable, IFormattable;
+ bool ReadEnum(ref int value);
/// <summary>
/// Reads an sfixed32 field value from the stream.
|