Commit Graph
108 Commits
Author SHA1 Message Date
James Newton-King 91af95d77e -Fixed unhelpful error when failing conversion in JsonReader.ReadAsDecimal
-Fixed JsonReader.ReadAsInt32 with BigInteger values
2018-02-17 18:46:27 +13:00
James Newton-King 73203653ba -Fixed unhelpful error when failing conversion in JsonReader.ReadAsInt32 2018-02-17 18:04:00 +13:00
James Newton-King 9932155295 -Refactor to expression body properties 2017-10-23 09:49:12 +13:00
James Newton-King 8dd5eff2ee -Minor refactor 2017-10-14 12:18:10 +13:00
James Newton-King 403470d59a -Fixed not erroring when reading undefined for nullable long 2017-07-23 13:50:49 +12:00
James Newton-King 6aed848eca -Added support for reading multiple comma delimited values with JsonReader.SupportMultipleContent 2017-07-01 16:43:15 +12:00
James Newton-King 7726b51091 -Fixed reading some types from KeyValuePairConverter incorrectly 2017-05-28 00:47:09 +12:00
James Newton-King 1535268ab8 -Fixed JToken.Load not reading past comment when CommentHandling is Ignore
-Fix JsonReader.ReadAsDecimal with JValue and BigInteger value
2017-05-13 19:14:16 +12:00
James Newton-King 7fff485208 -Added protected JsonReader.SetToken method with option not to update position array index 2017-03-14 20:30:03 +13:00
Florian Greinacher b8e60c773b Change ifdefs to be by feature, not by platform (#1146)
* First pass

* Second pass

* Third pass

* Temporarily change build script to build only portable

* Add portable features for release build

* Add feature constants to build script

* Add more feature constants to build script

* Fix build issues

* Fix build issues

* Get rid of constants in build.ps1

* HAVE_NUMERICS -> HAVE_BIG_INTEGER

* Remove HAVE_NULLABLE

* Remove HAVE_NUMERICS from csprojs

* Add missing ifdef

* Add feature defines to pj

* Re-enable netstd builds

* Fix defines in pj

* Trying to get better build outputs

* Trying to get the build error

* Use newer cli

* Address review feedback; make netstd build work

* Introduce HAVE_DB_NULL_TYPE

* Adapt to upstream changes; address remaining review feedback

* Adapt to upstream changes; address remaining review feedback

* Rename some constants for constistency

* Address review feedback

* -Fixed build with signed assembly

* Fix merge erorr

* Address review feedback

* Introduce HAVE_NON_SERIALIZED_ATTRIBUTE

* HAVE_IGNORE_DATA_MEMBER_ATTRIBUTE
2017-01-12 11:07:02 +13:00
James Newton-King ba79136e4e Merge pull request #1151 from JonHanna/singleton_empty_array
Use singleton for zero-element arrays.
2017-01-09 15:11:14 +13:00
Jon Hanna ff3bfaf51b Use singleton for zero-element arrays.
Create an easily-inlinable method that accesses the array used
by Enumerable.Empty (and hence not just shared within this project
but likely with the client assembly or other libraries it uses)
and use it anywhere a zero-element array is used, reducing allocations.
2017-01-09 01:50:03 +00:00
Jon Hanna ec2659e3ad Merge ifs into following switch on same expression in ReadAsBytes (#1147) 2017-01-09 14:01:18 +13:00
Jon Hanna f4c17aedb2 Coalesce nulls rather than null test where applicable. (#1150) 2017-01-08 15:36:31 +13:00
Jon Hanna f663060005 Asynchronous methods in readers and writers. (#1122)
Contributes to #650
2017-01-06 15:33:39 +13:00
Jon Hanna a95665b481 Replace is-and-cast with as-and-nullcheck
Gives slightly better performance, so applying across the board
adds up.
2017-01-05 01:52:04 +00:00
stakx 1eb391c147 Replace "stream" in reader/writer classes' comments
XML documentation comments for JsonReader, JsonWriter and derived
classes often mention "underlying streams". In most cases however,
these types don't operate directly on Streams, but through other types
such as TextReader and TextWriter.

This commit changes these comments to reflect more accurately what
kind of objects the various JSON reader / writer classes operate on.

Additionally the effect of JsonReader.CloseInput and JsonWriter.Close-
Output is made more explicit in the comments for the Close methods.
2016-12-24 02:26:16 +01:00
stakx e19ac3f28c Add & fix crefs in XML document comments
* Add references to types where they are missing.

 * Fix incorrect references to closed generic types.

 * Convert member ID strings to proper references where they can be
   converted without breaking the build. The remaining member ID
   strings usually mean that the comment would have to be rephrased
   for at least one build target / platform.

 * Drop namespaces from type names where they are unnecessary.

 * Fix the odd typo and add additional <c> markup in a few places.
2016-12-23 16:15:24 +01:00
stakx 937d5a53bb XML comments: consistent formatting of C# keywords 2016-12-19 09:29:22 +01:00
stakx 2e6d2ecd4c Fix typos, punctuation, etc. in XML doc comments
* Simple stuff: typos and missing punctuation and line breaks.

 * Sometimes, two method overloads have quite different documentation.
   Rephrase these to make them more similar.

 * Minor rephrasings like in a previous commit (e.g. "...how output
   should be formatted", "initializes a new instance of...").

 * Obvious incorrect type references in comments. These appear mostly
   in `Utilities/LinqBridge.cs` (nullable vs non-nullable).

 * Remove factually incorrect statement about exceptions thrown.

 * Remove comments for explicitly implemented interface methods.
2016-12-18 01:01:46 +01:00
stakx 01f370d1ff Change comments as per @JamesNK's feedback
* Explicitly implemented interfaces don't need comments.

 * Protected constructors of abstract classes should be documented
   like Microsoft does on MSDN.

 * Replace term "Common Language Runtime (CLR) type" with ".NET type".
2016-12-11 01:19:50 +01:00
stakx 067768a658 Fix minor issues in XML documentation comments
This fixes several minor issues in the code's documentation comments,
such as spelling errors, missing punctuation and references to other
code elements, and a few other small inconsistencies.
2016-12-10 22:53:40 +01:00
Mikko Rantanen b47f7440d1 Fix null reference error when deserializing bytes
If the JSON contained empty object "{}" for a byte[] property, the `JsonReader` ended up trying to read the object content despite the fact that the content didn't exist. This caused a null reference exception.

The fix ensures the value exists before trying to read it. If the value doesn't exist, the execution ends up in "Unexpected token" exception with way more informative error message.
2016-11-05 15:38:52 +02:00
James Newton-King 68d160f3c6 -Added netstandard1.1 with BigInteger support 2016-09-10 23:54:44 +12:00
Discosultan 3bfc8223a1 Unify the usage of <c> tags for true/false values in XML docs 2016-05-24 17:29:03 +03:00
James Newton-King 5b04a61dd9 -Fixed JsonReader.ReadAsDouble with a JValue BigInteger 2016-04-29 18:49:22 +12:00
James Newton-King 70120ce077 -Fixed ReadAsBytes with type name handling 2016-01-08 22:37:05 +13:00
James Newton-King 2c5322c302 -Increment version to 8.0.2
-Tests
2016-01-08 21:31:18 +13:00
James Newton-King 9021858293 -Added ReadAsBoolean
-Fixed reading booleans as strings
-Fixed reading large integers as booleans
2016-01-05 22:12:01 +13:00
James Newton-King ce2a08dba2 -Formatting 2015-12-27 14:31:36 +13:00
James Newton-King 3773eb5be7 -Added ReadAsDouble 2015-12-26 15:53:27 +13:00
James Newton-King 7f290b5a85 -JsonReader ReadAsBytes refactor 2015-12-26 13:14:31 +13:00
James Newton-King 027bfe46cb -JsonReader refactor fixes 2015-12-26 09:37:50 +13:00
James Newton-King d1451bd4ae -JsonReader refactor 2015-12-26 01:55:36 +13:00
James Newton-King a7046b0f6c -Refactor 2015-12-20 18:07:25 +13:00
Jon Hanna a06716c6a6 Refactor some cases of repeated code into separate methods.
Make the MoveToContent() and ReadToContent() produced from this public.
2015-12-20 00:28:40 +00:00
Jon Hanna 40bd051809 Suppress finaliser in Dispose if there's a protected Dispose(bool)
Fixes #746
2015-12-18 19:03:36 +00:00
James Newton-King 815b283e58 -Refactored buffer pool 2015-12-13 15:40:37 +13:00
James Newton-King eb0cbd6a75 -Formatting
-Build
2015-12-04 23:54:38 +13:00
James Newton-King 7903b4b2e2 -Added JsonLoadSettings.LineInfoHandling 2015-11-21 19:31:17 +13:00
James Newton-King a3eb2d596c -Fixed DateTimeZoneHandling not being used when writing DateTime dictionary keys
-Buffer pooling fixes
-Improved date parsing performance
2015-11-14 15:22:59 +13:00
James Newton-King ac1a46bd14 -Added IJsonBufferPool, performance stuff 2015-11-12 22:08:39 +13:00
James Newton-King 9e29489e5a -Added support for reading GUID strings as bytes in JsonTextReader
-Changed reading GUIDs as bytes to only support 00000000-0000-0000-0000-000000000000 format
2015-06-10 17:10:16 +12:00
James Newton-King e9dc993fc3 -Explicit culture for tests
-Tests
2014-12-22 00:11:57 +13:00
James Newton-King 82025bc5b7 -Added JContainer.DescendantsAndSelf
-Added CurrentToken to JTokenReader
2014-12-07 16:08:27 +13:00
James Newton-King fea3ffddeb -Fixed array XML documentation references 2014-11-29 16:25:16 +13:00
James Newton-King e32b4671c8 -Added MetadataPropertyHandling.Ignore 2014-07-20 18:29:31 +12:00
James Newton-King 07baae515a -Fixed MetadataHandling.ReadAhead bugs 2014-07-20 12:26:00 +12:00
James Newton-King 3335ae4e20 -Fixed property after empty array JSONPath queries
-Fixed error handling when last value in array or object fails
2014-06-28 00:42:41 +12:00
James Newton-King 6b08fbc2fa -Code cleanup 2014-06-15 21:02:35 +12:00