This repository has been archived by the owner on Dec 18, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Update LockFileFormat to use JsonDeserializer 2. Also remove all references to Newtonsoft.Json from Microsoft.Framework.Runtime 3. Accept a TextReader instead of stream; 4. Trim down unnecessary code which includes UTF16 validator, number parsing. 5. Rename JsonContent to JsonBuffer 6. JsonBuffer read word instead of charactor
- Loading branch information
Showing
36 changed files
with
1,142 additions
and
1,644 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/Microsoft.Framework.Runtime.Hosting/Json/JsonBoolean.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace Microsoft.Framework.Runtime.Json | ||
{ | ||
internal class JsonBoolean : JsonValue | ||
{ | ||
public JsonBoolean(JsonToken token) | ||
: base(token.Line, token.Column) | ||
{ | ||
if (token.Type == JsonTokenType.True) | ||
{ | ||
Value = true; | ||
} | ||
else if (token.Type == JsonTokenType.False) | ||
{ | ||
Value = false; | ||
} | ||
else | ||
{ | ||
throw new ArgumentException("Token value should be either True or False.", nameof(token)); | ||
} | ||
} | ||
|
||
public bool Value { get; private set; } | ||
|
||
public static implicit operator bool (JsonBoolean jsonBoolean) | ||
{ | ||
return jsonBoolean.Value; | ||
} | ||
} | ||
} |
Oops, something went wrong.