aboutsummaryrefslogtreecommitdiff
path: root/csharp/ProtocolBuffers/Descriptors/FieldType.cs
diff options
context:
space:
mode:
authorJon Skeet <skeet@pobox.com>2008-08-14 20:33:35 +0100
committerJon Skeet <skeet@pobox.com>2008-08-14 20:33:35 +0100
commitc0daf107249d95f454d489613de09a4898cefb20 (patch)
treebb95ccdec5b2b6156709ac29febf99ee73087e78 /csharp/ProtocolBuffers/Descriptors/FieldType.cs
parent800f65e20915d3cda9b6b681013dc0a5dd5ddee2 (diff)
downloadprotobuf-c0daf107249d95f454d489613de09a4898cefb20.tar.gz
protobuf-c0daf107249d95f454d489613de09a4898cefb20.tar.bz2
protobuf-c0daf107249d95f454d489613de09a4898cefb20.zip
Changed fixed size methods to return unsigned integers. Finished FieldSet. Introduced mapping from FieldType to WireType and MappedType.
Diffstat (limited to 'csharp/ProtocolBuffers/Descriptors/FieldType.cs')
-rw-r--r--csharp/ProtocolBuffers/Descriptors/FieldType.cs40
1 files changed, 22 insertions, 18 deletions
diff --git a/csharp/ProtocolBuffers/Descriptors/FieldType.cs b/csharp/ProtocolBuffers/Descriptors/FieldType.cs
index d54ded53..30b82d69 100644
--- a/csharp/ProtocolBuffers/Descriptors/FieldType.cs
+++ b/csharp/ProtocolBuffers/Descriptors/FieldType.cs
@@ -1,23 +1,27 @@

namespace Google.ProtocolBuffers.Descriptors {
+ /// <summary>
+ /// Enumeration of all the possible field types. The odd formatting is to make it very clear
+ /// which attribute applies to which value, while maintaining a compact format.
+ /// </summary>
public enum FieldType {
- Double,
- Float,
- Int64,
- UInt64,
- Int32,
- Fixed64,
- Fixed32,
- Bool,
- String,
- Group,
- Message,
- Bytes,
- UInt32,
- SFixed32,
- SFixed64,
- SInt32,
- SInt64,
- Enum
+ [FieldMapping(MappedType.Double, WireFormat.WireType.Fixed64)] Double,
+ [FieldMapping(MappedType.Single, WireFormat.WireType.Fixed32)] Float,
+ [FieldMapping(MappedType.Int64, WireFormat.WireType.Varint)] Int64,
+ [FieldMapping(MappedType.UInt64, WireFormat.WireType.Varint)] UInt64,
+ [FieldMapping(MappedType.Int32, WireFormat.WireType.Varint)] Int32,
+ [FieldMapping(MappedType.UInt64, WireFormat.WireType.Fixed64)] Fixed64,
+ [FieldMapping(MappedType.UInt32, WireFormat.WireType.Fixed32)] Fixed32,
+ [FieldMapping(MappedType.Boolean, WireFormat.WireType.Varint)] Bool,
+ [FieldMapping(MappedType.String, WireFormat.WireType.LengthDelimited)] String,
+ [FieldMapping(MappedType.Message, WireFormat.WireType.StartGroup)] Group,
+ [FieldMapping(MappedType.Message, WireFormat.WireType.LengthDelimited)] Message,
+ [FieldMapping(MappedType.ByteString, WireFormat.WireType.LengthDelimited)] Bytes,
+ [FieldMapping(MappedType.UInt32, WireFormat.WireType.Varint)] UInt32,
+ [FieldMapping(MappedType.Int32, WireFormat.WireType.Fixed32)] SFixed32,
+ [FieldMapping(MappedType.Int64, WireFormat.WireType.Fixed64)] SFixed64,
+ [FieldMapping(MappedType.Int32, WireFormat.WireType.Varint)] SInt32,
+ [FieldMapping(MappedType.Int64, WireFormat.WireType.Varint)] SInt64,
+ [FieldMapping(MappedType.Enum, WireFormat.WireType.Varint)] Enum
}
}