WireType.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. namespace ProtoBuf
  2. {
  3. /// <summary>
  4. /// Indicates the encoding used to represent an individual value in a protobuf stream
  5. /// </summary>
  6. public enum WireType
  7. {
  8. /// <summary>
  9. /// Represents an error condition
  10. /// </summary>
  11. None = -1,
  12. /// <summary>
  13. /// Base-128 variant-length encoding
  14. /// </summary>
  15. Variant = 0,
  16. /// <summary>
  17. /// Fixed-length 8-byte encoding
  18. /// </summary>
  19. Fixed64 = 1,
  20. /// <summary>
  21. /// Length-variant-prefixed encoding
  22. /// </summary>
  23. String = 2,
  24. /// <summary>
  25. /// Indicates the start of a group
  26. /// </summary>
  27. StartGroup = 3,
  28. /// <summary>
  29. /// Indicates the end of a group
  30. /// </summary>
  31. EndGroup = 4,
  32. /// <summary>
  33. /// Fixed-length 4-byte encoding
  34. /// </summary>10
  35. Fixed32 = 5,
  36. /// <summary>
  37. /// This is not a formal wire-type in the "protocol buffers" spec, but
  38. /// denotes a variant integer that should be interpreted using
  39. /// zig-zag semantics (so -ve numbers aren't a significant overhead)
  40. /// </summary>
  41. SignedVariant = WireType.Variant | (1 << 3),
  42. }
  43. }