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 {
}
try {
// TODO(jonskeet): Check signage for Int32 and Int64.
switch (FieldType) {
case FieldType.Int32:
case FieldType.SInt32:
......@@ -348,7 +347,13 @@ namespace Google.ProtocolBuffers.Descriptors {
defaultValue = double.Parse(Proto.DefaultValue);
break;
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;
case FieldType.String:
defaultValue = Proto.DefaultValue;
......
......@@ -22,7 +22,9 @@ namespace Google.ProtocolBuffers.Descriptors {
/// The index of this descriptor within its parent descriptor.
/// </value>
/// <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>
public int 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