Commit cd851908 authored by Jon Skeet's avatar Jon Skeet

Two more which should have been in the last commit

parent 3351bb63
...@@ -321,7 +321,6 @@ namespace Google.ProtocolBuffers.Descriptors { ...@@ -321,7 +321,6 @@ namespace Google.ProtocolBuffers.Descriptors {
} }
try { try {
// TODO(jonskeet): Check signage for Int32 and Int64.
switch (FieldType) { switch (FieldType) {
case FieldType.Int32: case FieldType.Int32:
case FieldType.SInt32: case FieldType.SInt32:
...@@ -348,7 +347,13 @@ namespace Google.ProtocolBuffers.Descriptors { ...@@ -348,7 +347,13 @@ namespace Google.ProtocolBuffers.Descriptors {
defaultValue = double.Parse(Proto.DefaultValue); defaultValue = double.Parse(Proto.DefaultValue);
break; break;
case FieldType.Bool: case FieldType.Bool:
defaultValue = bool.Parse(Proto.DefaultValue); // TODO(jonskeet): Check this will work if (Proto.DefaultValue == "true") {
defaultValue = true;
} else if (Proto.DefaultValue == "false") {
defaultValue = false;
} else {
throw new FormatException("Boolean values must be \"true\" or \"false\"");
}
break; break;
case FieldType.String: case FieldType.String:
defaultValue = Proto.DefaultValue; defaultValue = Proto.DefaultValue;
......
...@@ -22,7 +22,9 @@ namespace Google.ProtocolBuffers.Descriptors { ...@@ -22,7 +22,9 @@ namespace Google.ProtocolBuffers.Descriptors {
/// The index of this descriptor within its parent descriptor. /// The index of this descriptor within its parent descriptor.
/// </value> /// </value>
/// <remarks> /// <remarks>
/// TODO(jonskeet): Transcribe appropriately. /// This returns the index of this descriptor within its parent, for
/// this descriptor's type. (There can be duplicate values for different
/// types, e.g. one enum type with index 0 and one message type with index 0.)
/// </remarks> /// </remarks>
public int Index { public int Index {
get { return index; } get { return index; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment