Commit Graph
16 Commits
Author SHA1 Message Date
Atsushi Eno 696ff71de2 Revert PushbackReader changes (was unnecessary and actually bogus). 2011-04-05 20:26:09 +09:00
Atsushi Eno 5670f5b5ce Auto-detect text encoding from input stream for JsonReader. Fix DBCS pushback. 2011-04-05 18:22:56 +09:00
Andreia Gaita 987ef9dbab [Json] Add support for calling external json (de)serialization methods
On Moonlight, ScriptObject types have custom (de)serialization methods that
need to be called whenever a user object includes properties of that type.
This patch creates a TypeMap subclass (ExternalTypeMap) and exposes a method
that can be called from moon's System.Windows.Browser to register custom
serialization and deserialization methods, keyed by type. These are called
whenever a property is found with a type (or base type) that has custom
methods registered.
2010-10-16 19:58:08 +01:00
Atsushi Eno 13e5341363 2010-07-06 Atsushi Enomoto <[email protected]>
* JsonReader.cs : do not keep Attribute state once Read() is called.


svn path=/trunk/mcs/; revision=159942
2010-07-06 08:53:58 +00:00
Atsushi Eno 6557535276 2009-12-11 Atsushi Enomoto <[email protected]>
* JsonReader.cs : e- and e+ was resulting in wrong parse error.
	  This should fix part of bug #531904.

	* JsonReaderTest.cs : another number parse case.


svn path=/trunk/mcs/; revision=148099
2009-12-11 12:54:10 +00:00
Chris Toshok 7297458838 in System.ServiceModel.Web/System.Runtime.Serialization.Json:
2009-12-07  Chris Toshok  <[email protected]>

	* JsonReaderWriterFactory.cs (CreateJsonReader): pass null for the
	encoding parameter instead of calling Detect.  The jsonreader's
	PushbackReader will autodetect.
	(Detect): remove.  a BufferedStream created from an unseekable
	stream is itself unseekable, which makes it just as useless.  This
	breaks netflix's isostore file parsing.

	* JsonReader.cs (PushbackReader): add a ctor which doesn't take an
	encoding, for the autodetecting reader case.  for this ctor, pass
	true to StreamReader's ctor for detectEncodingFromByteOrderMarks.

svn path=/trunk/mcs/; revision=147829
2009-12-08 04:56:29 +00:00
Chris Toshok 8718686805 in class/corlib/System.Collections.Generic/:
2009-12-06  Chris Toshok  <[email protected]>

	* KeyValuePair.cs: we need setters for Key and Value so they can
	be set via reflection from
	System.ServiceModel.System.Runtime.Serialization.Json.TypeMap.cs.

in class/System.ServiceModel.Web/System.Runtime.Serialization.Json/:
2009-12-06  Chris Toshok  <[email protected]>

	* JsonSerializationReader.cs (DeserializeGenericCollection): this
	is jb's (iirc) patch, actually.  Types subclassing from
	ICollection<T> need to be supported, and since it's an interface
	the implementation might be explicit.  So instead of groveling
	around in the actual type, we need to dispatch through the
	interface's method.

	* TypeMap.cs (CreateDefaultTypeMap): we need to include non-public
	properties, since KeyValuePair items must be able to write to Key
	and Value properties.

	* JsonReader.cs (ReadContent): for builtin values (null, true,
	false), use TryReadString instead of individual ReadChar's, since
	they aren't reversible if the string didn't match.  In the default
	case, if we're LameSilverlightLiseralParser, we need to push back
	the current character onto the stream -- this is because for
	netflix's AppConfig.json we were parsing "frameRatePolicy" as
	"rameRatePolicy" (the 'f' was triggering the "false" parsing).
	(class PushBackReader): add this class to unify all the pushing
	back of characters we need to do.  1 character (JsonReader's old
	"saved_char") isn't enough given that you could have a property
	named, e.g., "falsifiable", and we'd need 4 characters worth of
	pushback to recognize that correctly.

svn path=/trunk/mcs/; revision=147766
2009-12-07 07:39:17 +00:00
Atsushi Eno f2689b52df 2009-11-20 Atsushi Enomoto <[email protected]>
* DataContractJsonSerializer.cs, JsonReader.cs : Silverlight uses
	  LAME parser that allows object member name as *raw* string
	  without double-quotes. (This also reverts the previous change.)

	* DataContractJsonSerializerTest.cs : added ignored test case that
	  verifies 2.1 behavior (with another case that justifies removal
	  of the previous hack).


svn path=/trunk/mcs/; revision=146599
2009-11-20 06:07:51 +00:00
Geoff Norton f5938b9d55 ensure we add punctuation as characters, patch from john moshakis
svn path=/trunk/mcs/; revision=145361
2009-11-04 01:39:41 +00:00
Atsushi Eno b5eb01a3ae 2009-10-05 Atsushi Enomoto <[email protected]>
* JsonReader.cs : copy string literal parser from System.Json.


svn path=/trunk/mcs/; revision=143433
2009-10-05 18:47:34 +00:00
Andreia Gaita ae2770b9c3 2009-03-13 Andreia Gaita <[email protected]>
* JsonReader.cs: fix depth calculation
	* JsonReaderTest.cs: test for skip and depth (if depth fails, skip is affected)

svn path=/trunk/mcs/; revision=129240
2009-03-13 03:09:30 +00:00
Chris Toshok 53fd125cbe In System.Runtime.Serialization/System.Xml:
2009-03-02  Chris Toshok  <[email protected]>

	* XmlBinaryDictionaryReader.cs, XmlSimpleDictionaryReader.cs: 2.1
	has HasValue.

In System.XML/System.Xml:
2009-03-02  Chris Toshok  <[email protected]>

	* XmlReader.cs, XmlTextReader.cs, XmlTextReader2.cs,
	EntityResolvingXmlReader.cs: 2.1 has HasValue.


In System.XML/Mono.Xml:
2009-03-02  Chris Toshok  <[email protected]>

	* SubtreeXmlReader.cs, XmlFilterReader.cs: 2.1 has HasValue.

In System.Xml.Linq/System.Xml.Linq:
2009-03-02  Chris Toshok  <[email protected]>

	* XNodeReader.cs: 2.1 has HasValue.

In System.ServiceModel.Web/System.Runtime.Serialization.Json:
2009-03-02  Chris Toshok  <[email protected]>

	* JsonReader.cs: 2.1 has HasValue.


svn path=/trunk/mcs/; revision=128406
2009-03-03 00:44:33 +00:00
Geoff Norton 2ad30c4516 2009-02-19 Geoff Norton <[email protected]>
* Fix the build, these all need to loose this #if guard.

svn path=/trunk/mcs/; revision=127378
2009-02-19 07:09:22 +00:00
Atsushi Eno 78c9e57f94 2009-02-02 Atsushi Enomoto <[email protected]>
* JsonReader.cs : show invalid input character in the error
          message.


svn path=/trunk/mcs/; revision=125341
2009-02-02 12:38:03 +00:00
Jb Evain 88bb572e14 2008-09-12 Jb Evain <[email protected]>
* net_2_1_raw_System.ServiceModel.Web.dll.sources
	* Makefile
	* System.Runtime.Serialization.Json/JsonReader.cs:
		support the SL2 profile compilation.


svn path=/trunk/mcs/; revision=112863
2008-09-12 11:52:10 +00:00
Jb Evain 982e3b35a4 move to from olive to mcs
svn path=/trunk/mcs/; revision=111188
2008-08-20 21:25:05 +00:00