2 using System.Collections.Generic;
3 using System.Globalization;
8 namespace Newtonsoft.Json.Linq
11 /// Represents a raw JSON string.
13 public class JRaw : JValue
16 /// Initializes a new instance of the <see cref="JRaw"/> class from another <see cref="JRaw"/> object.
18 /// <param name="other">A <see cref="JRaw"/> object to copy from.</param>
19 public JRaw(JRaw other)
25 /// Initializes a new instance of the <see cref="JRaw"/> class.
27 /// <param name="rawJson">The raw json.</param>
28 public JRaw(object rawJson)
29 : base(rawJson, JTokenType.Raw)
34 /// Creates an instance of <see cref="JRaw"/> with the content of the reader's current token.
36 /// <param name="reader">The reader.</param>
37 /// <returns>An instance of <see cref="JRaw"/> with the content of the reader's current token.</returns>
38 public static JRaw Create(JsonReader reader)
40 using (StringWriter sw = new StringWriter(CultureInfo.InvariantCulture))
41 using (JsonTextWriter jsonWriter = new JsonTextWriter(sw))
43 jsonWriter.WriteToken(reader);
45 return new JRaw(sw.ToString());
49 internal override JToken CloneToken()
51 return new JRaw(this);