diff options
Diffstat (limited to 'Src/Newtonsoft.Json/JsonValidatingReader.cs')
-rw-r--r-- | Src/Newtonsoft.Json/JsonValidatingReader.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Src/Newtonsoft.Json/JsonValidatingReader.cs b/Src/Newtonsoft.Json/JsonValidatingReader.cs index 15c5ff4..2bf2af6 100644 --- a/Src/Newtonsoft.Json/JsonValidatingReader.cs +++ b/Src/Newtonsoft.Json/JsonValidatingReader.cs @@ -390,6 +390,30 @@ namespace Newtonsoft.Json return d;
}
+ /// <summary>
+ /// Reads the next JSON token from the stream as a <see cref="String"/>.
+ /// </summary>
+ /// <returns>A <see cref="String"/>. This method will return <c>null</c> at the end of an array.</returns>
+ public override string ReadAsString()
+ {
+ string s = _reader.ReadAsString();
+
+ ValidateCurrentToken();
+ return s;
+ }
+
+ /// <summary>
+ /// Reads the next JSON token from the stream as a <see cref="Nullable{DateTime}"/>.
+ /// </summary>
+ /// <returns>A <see cref="String"/>. This method will return <c>null</c> at the end of an array.</returns>
+ public override DateTime? ReadAsDateTime()
+ {
+ DateTime? dateTime = _reader.ReadAsDateTime();
+
+ ValidateCurrentToken();
+ return dateTime;
+ }
+
#if !NET20
/// <summary>
/// Reads the next JSON token from the stream as a <see cref="Nullable{DateTimeOffset}"/>.
|