 | Utf8String Class |
A mutable string stored and serialized in utf-8 format.
Inheritance Hierarchy Namespace: Ookii.Jumbo.IOAssembly: Ookii.Jumbo (in Ookii.Jumbo.dll) Version: 0.3.0+dc1307f20e065bb638e0b73a34cd216f57e486f1
Syntaxpublic sealed class Utf8String : IWritable,
IEquatable<Utf8String>, IComparable<Utf8String>, IComparable,
ICloneable, ISpanFormattable, IFormattable, IUtf8SpanFormattable, ISpanParsable<Utf8String>,
IParsable<Utf8String>, IUtf8SpanParsable<Utf8String>
Public NotInheritable Class Utf8String
Implements IWritable, IEquatable(Of Utf8String),
IComparable(Of Utf8String), IComparable, ICloneable, ISpanFormattable,
IFormattable, IUtf8SpanFormattable, ISpanParsable(Of Utf8String), IParsable(Of Utf8String),
IUtf8SpanParsable(Of Utf8String)
public ref class Utf8String sealed : IWritable,
IEquatable<Utf8String^>, IComparable<Utf8String^>, IComparable,
ICloneable, ISpanFormattable, IFormattable, IUtf8SpanFormattable, ISpanParsable<Utf8String^>,
IParsable<Utf8String^>, IUtf8SpanParsable<Utf8String^>
[<SealedAttribute>]
type Utf8String =
class
interface IWritable
interface IEquatable<Utf8String>
interface IComparable<Utf8String>
interface IComparable
interface ICloneable
interface ISpanFormattable
interface IFormattable
interface IUtf8SpanFormattable
interface ISpanParsable<Utf8String>
interface IParsable<Utf8String>
interface IUtf8SpanParsable<Utf8String>
end
The Utf8String type exposes the following members.
Constructors
Properties | Name | Description |
---|
 | ByteLength |
Gets the number of bytes in the encoded string.
|
 | Bytes |
Gets the bytes of the utf-8 encoded string.
|
 | Capacity |
Gets or sets the maximum size, in bytes, of the string this instance can hold without
resizing.
|
 | CharLength |
Gets the length of the string in characters.
|
Top
Methods | Name | Description |
---|
 | Append(ReadOnlySpanByte) |
Appends a span containing utf-8 encoded data to this string.
|
 | Append(Utf8String) |
Appends the specified Utf8String to this instance..
|
 | Clone |
Creates a clone of the current Utf8String.
|
 | CompareTo(Object) |
Compares the current instance with another object of the same type and returns an integer that
indicates whether the current instance precedes, follows, or occurs in the same position in the
sort order as the other object.
|
 | CompareTo(Utf8String) |
Compares the current instance with another object of the same type and returns an integer that
indicates whether the current instance precedes, follows, or occurs in the same position in the
sort order as the other object.
|
 | Equals(Object) |
Tests this Utf8String for equality with the specified object.
(Overrides ObjectEquals(Object)) |
 | Equals(Utf8String) |
Tests this Utf8String for equality with the specified Utf8String.
|
 | GetHashCode |
Gets a hash code for this Utf8String.
(Overrides ObjectGetHashCode) |
  | GetLength |
Gets the length of a Utf8String stored in a byte array.
|
 | GetType | Gets the Type of the current instance. (Inherited from Object) |
  | Parse(ReadOnlySpanByte, IFormatProvider) | Parses a span of UTF-8 characters into a value. |
  | Parse(ReadOnlySpanChar, IFormatProvider) | Parses a span of characters into a value. |
  | Parse(String, IFormatProvider) | Parses a string into a value. |
 | Read |
Reads the object from the specified reader.
|
 | Set(ReadOnlySpanByte) |
Sets the value of this Utf8String to the specified region of the specified byte array.
|
 | Set(ReadOnlySpanChar) |
Sets the value of this Utf8String to the specified span of characters.
|
 | Set(String) |
Sets the value of this Utf8String to the specified String.
|
 | Set(Utf8String) |
Sets the value of this Utf8String to the value of the specified Utf8String.
|
 | ToString |
Gets a string representation of the current Utf8String.
(Overrides ObjectToString) |
 | ToString(String, IFormatProvider) | Formats the value of the current instance using the specified format. |
 | TryFormat(SpanByte, Int32, ReadOnlySpanChar, IFormatProvider) | Tries to format the value of the current instance as UTF-8 into the provided span of bytes. |
 | TryFormat(SpanChar, Int32, ReadOnlySpanChar, IFormatProvider) | Tries to format the value of the current instance into the provided span of characters. |
  | TryParse(ReadOnlySpanByte, IFormatProvider, Utf8String) | Tries to parse a span of UTF-8 characters into a value. |
  | TryParse(ReadOnlySpanChar, IFormatProvider, Utf8String) | Tries to parse a span of characters into a value. |
  | TryParse(String, IFormatProvider, Utf8String) | Tries to parse a string into a value. |
 | Write(BinaryWriter) |
Writes the object to the specified writer.
|
 | Write(Stream) |
Writes this Utf8String to the specified stream.
|
Top
Operators
Remarks Caution |
---|
The Utf8String class does not provide full utf-8 string manipulation. Its
primary use is as a mutable serialization format, providing a IWritable
record type that allows record reuse for strings. For string manipulation, conversion
to/from String will typically be necessary.
|
Note |
---|
Instances of the Utf8String class are compared per byte, and will not sort
in proper lexicographical order if the string contains multi-byte characters. The only
guarantee is that the ordering is deterministic.
|
Because this object is mutable you must take care when using it scenarios where immutability is expected, e.g. as a key
in a DictionaryTKey, TValue.
See Also