@@ -311,10 +311,26 namespace Implab.JSON { | |||||
311 | return Create(File.OpenText(file), options); |
|
311 | return Create(File.OpenText(file), options); | |
312 | } |
|
312 | } | |
313 |
|
313 | |||
|
314 | /// <summary> | |||
|
315 | /// Creates the XmlReader for the specified text stream with JSON data. | |||
|
316 | /// </summary> | |||
|
317 | /// <param name="reader">Text reader.</param> | |||
|
318 | /// <param name="options">Options.</param> | |||
|
319 | /// <remarks> | |||
|
320 | /// The reader will be disposed when the XmlReader is disposed. | |||
|
321 | /// </remarks> | |||
314 | public static JSONXmlReader Create(TextReader reader, JSONXmlReaderOptions options) { |
|
322 | public static JSONXmlReader Create(TextReader reader, JSONXmlReaderOptions options) { | |
315 | return new JSONXmlReader(new JSONParser(reader, true), options); |
|
323 | return new JSONXmlReader(new JSONParser(reader, true), options); | |
316 | } |
|
324 | } | |
317 |
|
325 | |||
|
326 | /// <summary> | |||
|
327 | /// Creates the XmlReader for the specified stream with JSON data. | |||
|
328 | /// </summary> | |||
|
329 | /// <param name="stream">Stream.</param> | |||
|
330 | /// <param name="options">Options.</param> | |||
|
331 | /// <remarks> | |||
|
332 | /// The stream will be disposed when the XmlReader is disposed. | |||
|
333 | /// </remarks> | |||
318 | public static JSONXmlReader Create(Stream stream, JSONXmlReaderOptions options) { |
|
334 | public static JSONXmlReader Create(Stream stream, JSONXmlReaderOptions options) { | |
319 | Safe.ArgumentNotNull(stream, "stream"); |
|
335 | Safe.ArgumentNotNull(stream, "stream"); | |
320 | // HACK don't dispose StreaReader to keep stream opened |
|
336 | // HACK don't dispose StreaReader to keep stream opened |
@@ -41,7 +41,7 namespace Implab.Parsing { | |||||
41 | int m_chunkSize = 1024; // 1k |
|
41 | int m_chunkSize = 1024; // 1k | |
42 | int m_limit = 10 * 1024 * 1024; // 10Mb |
|
42 | int m_limit = 10 * 1024 * 1024; // 10Mb | |
43 |
|
43 | |||
44 |
p |
|
44 | protected Scanner(CDFADefinition definition) { | |
45 | Safe.ArgumentNotNull(definition, "definition"); |
|
45 | Safe.ArgumentNotNull(definition, "definition"); | |
46 |
|
46 | |||
47 | m_states = definition.States; |
|
47 | m_states = definition.States; |
General Comments 0
You need to be logged in to leave comments.
Login now