Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
290 lines (268 sloc) 15.9 KB
<Type Name="JsonEncodedText" FullName="System.Text.Json.JsonEncodedText">
<TypeSignature Language="C#" Value="public struct JsonEncodedText : IEquatable&lt;System.Text.Json.JsonEncodedText&gt;" />
<TypeSignature Language="ILAsm" Value=".class public sequential ansi sealed beforefieldinit JsonEncodedText extends System.ValueType implements class System.IEquatable`1&lt;valuetype System.Text.Json.JsonEncodedText&gt;" />
<TypeSignature Language="DocId" Value="T:System.Text.Json.JsonEncodedText" />
<TypeSignature Language="VB.NET" Value="Public Structure JsonEncodedText&#xA;Implements IEquatable(Of JsonEncodedText)" />
<TypeSignature Language="C++ CLI" Value="public value class JsonEncodedText : IEquatable&lt;System::Text::Json::JsonEncodedText&gt;" />
<TypeSignature Language="F#" Value="type JsonEncodedText = struct" />
<AssemblyInfo>
<AssemblyName>System.Text.Json</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.ValueType</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.IEquatable&lt;System.Text.Json.JsonEncodedText&gt;</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.CompilerServices.IsReadOnly</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Provides methods to transform UTF-8 or UTF-16 encoded text into a form that is suitable for JSON.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This type can be used to cache and store known strings used for writing JSON ahead of time by pre-encoding them up front.
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName="Encode">
<MemberSignature Language="C#" Value="public static System.Text.Json.JsonEncodedText Encode (ReadOnlySpan&lt;byte&gt; utf8Value, System.Text.Encodings.Web.JavaScriptEncoder encoder = null);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Text.Json.JsonEncodedText Encode(valuetype System.ReadOnlySpan`1&lt;unsigned int8&gt; utf8Value, class System.Text.Encodings.Web.JavaScriptEncoder encoder) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Text.Json.JsonEncodedText.Encode(System.ReadOnlySpan{System.Byte},System.Text.Encodings.Web.JavaScriptEncoder)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Encode (utf8Value As ReadOnlySpan(Of Byte), Optional encoder As JavaScriptEncoder = null) As JsonEncodedText" />
<MemberSignature Language="F#" Value="static member Encode : ReadOnlySpan&lt;byte&gt; * System.Text.Encodings.Web.JavaScriptEncoder -&gt; System.Text.Json.JsonEncodedText" Usage="System.Text.Json.JsonEncodedText.Encode (utf8Value, encoder)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Text.Json</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Text.Json.JsonEncodedText</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="utf8Value" Type="System.ReadOnlySpan&lt;System.Byte&gt;" />
<Parameter Name="encoder" Type="System.Text.Encodings.Web.JavaScriptEncoder" />
</Parameters>
<Docs>
<param name="utf8Value">The UTF-8 encoded text to convert to JSON encoded text.</param>
<param name="encoder">The encoder to use when escaping the string, or <see langword="null" /> to use the default encoder.</param>
<summary>Encodes a UTF-8 text value as a JSON string.</summary>
<returns>The encoded JSON text.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="utf8Value" /> is too large.
-or-
<paramref name="utf8Value" /> contains invalid UTF-8 bytes.</exception>
</Docs>
</Member>
<Member MemberName="Encode">
<MemberSignature Language="C#" Value="public static System.Text.Json.JsonEncodedText Encode (ReadOnlySpan&lt;char&gt; value, System.Text.Encodings.Web.JavaScriptEncoder encoder = null);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Text.Json.JsonEncodedText Encode(valuetype System.ReadOnlySpan`1&lt;char&gt; value, class System.Text.Encodings.Web.JavaScriptEncoder encoder) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Text.Json.JsonEncodedText.Encode(System.ReadOnlySpan{System.Char},System.Text.Encodings.Web.JavaScriptEncoder)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Encode (value As ReadOnlySpan(Of Char), Optional encoder As JavaScriptEncoder = null) As JsonEncodedText" />
<MemberSignature Language="F#" Value="static member Encode : ReadOnlySpan&lt;char&gt; * System.Text.Encodings.Web.JavaScriptEncoder -&gt; System.Text.Json.JsonEncodedText" Usage="System.Text.Json.JsonEncodedText.Encode (value, encoder)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Text.Json</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Text.Json.JsonEncodedText</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.ReadOnlySpan&lt;System.Char&gt;" />
<Parameter Name="encoder" Type="System.Text.Encodings.Web.JavaScriptEncoder" />
</Parameters>
<Docs>
<param name="value">The value to convert to JSON encoded text.</param>
<param name="encoder">The encoder to use when escaping the string, or <see langword="null" /> to use the default encoder.</param>
<summary>Encodes a specified text value as a JSON string.</summary>
<returns>The encoded JSON text.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="value" /> is too large.
-or-
<paramref name="value" /> contains invalid UTF-16 characters.</exception>
</Docs>
</Member>
<Member MemberName="Encode">
<MemberSignature Language="C#" Value="public static System.Text.Json.JsonEncodedText Encode (string value, System.Text.Encodings.Web.JavaScriptEncoder encoder = null);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype System.Text.Json.JsonEncodedText Encode(string value, class System.Text.Encodings.Web.JavaScriptEncoder encoder) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Text.Json.JsonEncodedText.Encode(System.String,System.Text.Encodings.Web.JavaScriptEncoder)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Encode (value As String, Optional encoder As JavaScriptEncoder = null) As JsonEncodedText" />
<MemberSignature Language="F#" Value="static member Encode : string * System.Text.Encodings.Web.JavaScriptEncoder -&gt; System.Text.Json.JsonEncodedText" Usage="System.Text.Json.JsonEncodedText.Encode (value, encoder)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Text.Json</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Text.Json.JsonEncodedText</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.String" />
<Parameter Name="encoder" Type="System.Text.Encodings.Web.JavaScriptEncoder" />
</Parameters>
<Docs>
<param name="value">The value to convert to JSON encoded text.</param>
<param name="encoder">The encoder to use when escaping the string, or <see langword="null" /> to use the default encoder.</param>
<summary>Encodes the string text value as a JSON string.</summary>
<returns>The encoded JSON text.</returns>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="value" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="value" /> is too large.
-or-
<paramref name="value" /> contains invalid UTF-16 characters.</exception>
</Docs>
</Member>
<Member MemberName="EncodedUtf8Bytes">
<MemberSignature Language="C#" Value="public ReadOnlySpan&lt;byte&gt; EncodedUtf8Bytes { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.ReadOnlySpan`1&lt;unsigned int8&gt; EncodedUtf8Bytes" />
<MemberSignature Language="DocId" Value="P:System.Text.Json.JsonEncodedText.EncodedUtf8Bytes" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property EncodedUtf8Bytes As ReadOnlySpan(Of Byte)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property ReadOnlySpan&lt;System::Byte&gt; EncodedUtf8Bytes { ReadOnlySpan&lt;System::Byte&gt; get(); };" />
<MemberSignature Language="F#" Value="member this.EncodedUtf8Bytes : ReadOnlySpan&lt;byte&gt;" Usage="System.Text.Json.JsonEncodedText.EncodedUtf8Bytes" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Text.Json</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.ReadOnlySpan&lt;System.Byte&gt;</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the UTF-8 encoded representation of the pre-encoded JSON text.</summary>
<value>The UTF-8 encoded representation of the pre-encoded JSON text.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public override bool Equals (object obj);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool Equals(object obj) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Text.Json.JsonEncodedText.Equals(System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function Equals (obj As Object) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override bool Equals(System::Object ^ obj);" />
<MemberSignature Language="F#" Value="override this.Equals : obj -&gt; bool" Usage="jsonEncodedText.Equals obj" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Text.Json</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="obj" Type="System.Object" />
</Parameters>
<Docs>
<param name="obj">The object to compare to this instance.</param>
<summary>Determines whether this instance and a specified object, which must also be a <see cref="T:System.Text.Json.JsonEncodedText" /> instance, have the same value.</summary>
<returns>
<see langword="true" /> if the current instance and <paramref name="obj" /> are equal; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If `obj` is `null`, the method returns `false`.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Equals">
<MemberSignature Language="C#" Value="public bool Equals (System.Text.Json.JsonEncodedText other);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool Equals(valuetype System.Text.Json.JsonEncodedText other) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Text.Json.JsonEncodedText.Equals(System.Text.Json.JsonEncodedText)" />
<MemberSignature Language="VB.NET" Value="Public Function Equals (other As JsonEncodedText) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual bool Equals(System::Text::Json::JsonEncodedText other);" />
<MemberSignature Language="F#" Value="override this.Equals : System.Text.Json.JsonEncodedText -&gt; bool" Usage="jsonEncodedText.Equals other" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.IEquatable`1.Equals(`0)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Text.Json</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="other" Type="System.Text.Json.JsonEncodedText" />
</Parameters>
<Docs>
<param name="other">The object to compare to this instance.</param>
<summary>Determines whether this instance and another specified <see cref="T:System.Text.Json.JsonEncodedText" /> instance have the same value.</summary>
<returns>
<see langword="true" /> if this instance and <paramref name="other" /> have the same value; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Default instances of <xref:System.Text.Json.JsonEncodedText> are treated as equal.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetHashCode">
<MemberSignature Language="C#" Value="public override int GetHashCode ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Text.Json.JsonEncodedText.GetHashCode" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetHashCode () As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetHashCode();" />
<MemberSignature Language="F#" Value="override this.GetHashCode : unit -&gt; int" Usage="jsonEncodedText.GetHashCode " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Text.Json</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns the hash code for this <see cref="T:System.Text.Json.JsonEncodedText" />.</summary>
<returns>The hash code for this instance.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method returns 0 on a default instance of <xref:System.Text.Json.JsonEncodedText>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ToString">
<MemberSignature Language="C#" Value="public override string ToString ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Text.Json.JsonEncodedText.ToString" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function ToString () As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::String ^ ToString();" />
<MemberSignature Language="F#" Value="override this.ToString : unit -&gt; string" Usage="jsonEncodedText.ToString " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Text.Json</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Converts the value of this instance to a <see cref="T:System.String" />.</summary>
<returns>The underlying UTF-16 encoded string.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method returns an empty string on a default instance of <xref:System.Text.Json.JsonEncodedText>.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.