aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers/TextFormat.cs
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2012-10-14 12:46:10 -0500
committerrogerk <devnull@localhost>2012-10-14 12:46:10 -0500
commit0d91952a584fea498b22fc180fcf599e85fd4933 (patch)
tree63ba2d54acf009baabc987eb2ab958ff5e42f8f5 /src/ProtocolBuffers/TextFormat.cs
parent14e011f61ba2f5976f287e67f4ad82e0cdc546cd (diff)
downloadprotobuf-0d91952a584fea498b22fc180fcf599e85fd4933.tar.gz
protobuf-0d91952a584fea498b22fc180fcf599e85fd4933.tar.bz2
protobuf-0d91952a584fea498b22fc180fcf599e85fd4933.zip
Refactoring compatibility code to use FrameworkPortability class
Diffstat (limited to 'src/ProtocolBuffers/TextFormat.cs')
-rw-r--r--src/ProtocolBuffers/TextFormat.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ProtocolBuffers/TextFormat.cs b/src/ProtocolBuffers/TextFormat.cs
index bbc76186..c0f4a5f6 100644
--- a/src/ProtocolBuffers/TextFormat.cs
+++ b/src/ProtocolBuffers/TextFormat.cs
@@ -170,10 +170,10 @@ namespace Google.ProtocolBuffers
// the double to/from string will trim the precision to 6 places. As with other numeric formats
// below, always use the invariant culture so it's predictable.
case FieldType.Float:
- generator.Print(((float) value).ToString("r", CultureInfo.InvariantCulture));
+ generator.Print(((float)value).ToString("r", FrameworkPortability.InvariantCulture));
break;
case FieldType.Double:
- generator.Print(((double) value).ToString("r", CultureInfo.InvariantCulture));
+ generator.Print(((double)value).ToString("r", FrameworkPortability.InvariantCulture));
break;
case FieldType.Int32:
@@ -188,7 +188,7 @@ namespace Google.ProtocolBuffers
case FieldType.Fixed64:
// The simple Object.ToString converts using the current culture.
// We want to always use the invariant culture so it's predictable.
- generator.Print(((IConvertible) value).ToString(CultureInfo.InvariantCulture));
+ generator.Print(((IConvertible)value).ToString(FrameworkPortability.InvariantCulture));
break;
case FieldType.Bool:
// Explicitly use the Java true/false
@@ -314,7 +314,7 @@ namespace Google.ProtocolBuffers
case "nanf":
return float.NaN;
default:
- return float.Parse(text, CultureInfo.InvariantCulture);
+ return float.Parse(text, FrameworkPortability.InvariantCulture);
}
}
@@ -331,7 +331,7 @@ namespace Google.ProtocolBuffers
case "nan":
return double.NaN;
default:
- return double.Parse(text, CultureInfo.InvariantCulture);
+ return double.Parse(text, FrameworkPortability.InvariantCulture);
}
}
@@ -708,7 +708,7 @@ namespace Google.ProtocolBuffers
{
// Explicitly specify the invariant culture so that this code does not break when
// executing in Turkey.
- String lowerName = name.ToLower(CultureInfo.InvariantCulture);
+ String lowerName = name.ToLower(FrameworkPortability.InvariantCulture);
field = type.FindDescriptor<FieldDescriptor>(lowerName);
// If the case-insensitive match worked but the field is NOT a group,
// TODO(jonskeet): What? Java comment ends here!