{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Struct FixedString4096Bytes | Collections | 2.3.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct FixedString4096Bytes

    An unmanaged UTF-8 string whose content is stored directly in the 4096-byte struct.

    Implements
    INativeList<byte>
    IIndexable<byte>
    IUTF8Bytes
    Namespace: Unity.Collections
    Assembly: solution.dll
    Syntax
    [Serializable]
    public struct FixedString4096Bytes : INativeList<byte>, IIndexable<byte>, IUTF8Bytes
    Remarks

    The binary layout of this string is guaranteed, for now and all time, to be a length (a little-endian two byte integer) followed by the bytes of the characters (with no padding). A zero byte always immediately follows the last character. Effectively, the number of bytes for storing characters is 3 less than 4096 (two length bytes and one null byte).

    This layout is identical to a FixedList4096Bytes<T> of bytes, thus allowing reinterpretation between FixedString4096Bytes and FixedList4096Bytes.

    By virtue of being an unmanaged, non-allocated struct with no pointers, this string is fully compatible with jobs and Burst compilation. Unlike managed string types, these strings can be put in any unmanaged ECS components, FixedList, or any other unmanaged structs.

    Constructors

    Name Description
    FixedString4096Bytes(string)

    Initializes and returns an instance of FixedString4096Bytes with the characters copied from a string.

    FixedString4096Bytes(in FixedString128Bytes)

    Initializes and returns an instance of FixedString4096Bytes that is a copy of another string.

    FixedString4096Bytes(in FixedString32Bytes)

    Initializes and returns an instance of FixedString4096Bytes that is a copy of another string.

    FixedString4096Bytes(in FixedString4096Bytes)

    Initializes and returns an instance of FixedString4096Bytes that is a copy of another string.

    FixedString4096Bytes(in FixedString512Bytes)

    Initializes and returns an instance of FixedString4096Bytes that is a copy of another string.

    FixedString4096Bytes(in FixedString64Bytes)

    Initializes and returns an instance of FixedString4096Bytes that is a copy of another string.

    FixedString4096Bytes(in UnsafeText)

    Initializes and returns an instance of FixedString4096Bytes that is a copy of another string.

    FixedString4096Bytes(ReadOnly)

    Initializes and returns an instance of FixedString4096Bytes that is a copy of another string.

    FixedString4096Bytes(Rune, int)

    Initializes and returns an instance of FixedString4096Bytes with a single character repeatedly appended some number of times.

    Properties

    Name Description
    Capacity

    The number of bytes this string has for storing UTF-8 characters.

    IsEmpty

    Returns true if this string is empty (has no characters).

    this[int]

    Returns the byte (not character) at an index.

    Length

    The current length in bytes of this string's content.

    UTF8MaxLengthInBytes

    Returns the maximum number of UTF-8 bytes that can be stored in this string.

    Methods

    Name Description
    Add(in byte)

    Appends a byte.

    AsFixedList()

    Returns a reference to a FixedList4096Bytes<byte> representation of this string.

    Clear()

    Sets the length to 0.

    CompareTo(string)

    Returns the lexicographical sort order of this string relative to another.

    CompareTo(FixedString128Bytes)

    Returns the lexicographical sort order of this string relative to another.

    CompareTo(FixedString32Bytes)

    Returns the lexicographical sort order of this string relative to another.

    CompareTo(FixedString4096Bytes)

    Returns the lexicographical sort order of this string relative to another.

    CompareTo(FixedString512Bytes)

    Returns the lexicographical sort order of this string relative to another.

    CompareTo(FixedString64Bytes)

    Returns the lexicographical sort order of this string relative to another.

    ElementAt(int)

    Returns the reference to a byte (not character) at an index.

    Equals(object)

    Returns true if this string and an object are equal.

    Equals(string)

    Returns true if this string and another have the same length and all the same characters.

    Equals(FixedString128Bytes)

    Returns true if this string and another string are equal.

    Equals(FixedString32Bytes)

    Returns true if this string and another string are equal.

    Equals(FixedString4096Bytes)

    Returns true if this string and another string are equal.

    Equals(FixedString512Bytes)

    Returns true if this string and another string are equal.

    Equals(FixedString64Bytes)

    Returns true if this string and another string are equal.

    GetEnumerator()

    Returns an enumerator for iterating over the characters of this string.

    GetHashCode()

    Returns a hash code of this string.

    GetUnsafePtr()

    Returns a pointer to the character bytes.

    ToString()

    Returns a new managed string that is a copy of this string.

    TryResize(int, NativeArrayOptions)

    Attempts to set the length in bytes. Does nothing if the new length is invalid.

    Operators

    Name Description
    operator ==(in FixedString4096Bytes, in FixedString128Bytes)

    Returns true if a FixedString4096Bytes and another string are equal.

    operator ==(in FixedString4096Bytes, in FixedString32Bytes)

    Returns true if a FixedString4096Bytes and another string are equal.

    operator ==(in FixedString4096Bytes, in FixedString4096Bytes)

    Returns true if a FixedString4096Bytes and another string are equal.

    operator ==(in FixedString4096Bytes, in FixedString512Bytes)

    Returns true if a FixedString4096Bytes and another string are equal.

    operator ==(in FixedString4096Bytes, in FixedString64Bytes)

    Returns true if a FixedString4096Bytes and another string are equal.

    implicit operator FixedString4096Bytes(string)

    Returns a new FixedString4096Bytes that is a copy of another string.

    operator !=(in FixedString4096Bytes, in FixedString128Bytes)

    Returns true if a FixedString4096Bytes and another string are unequal.

    operator !=(in FixedString4096Bytes, in FixedString32Bytes)

    Returns true if a FixedString4096Bytes and another string are unequal.

    operator !=(in FixedString4096Bytes, in FixedString4096Bytes)

    Returns true if a FixedString4096Bytes and another string are unequal.

    operator !=(in FixedString4096Bytes, in FixedString512Bytes)

    Returns true if a FixedString4096Bytes and another string are unequal.

    operator !=(in FixedString4096Bytes, in FixedString64Bytes)

    Returns true if a FixedString4096Bytes and another string are unequal.

    Extension Methods

    FixedStringMethods.AppendFormat<T, U, T0, T1, T2, T3, T4, T5, T6, T7>(ref T, in U, in T0, in T1, in T2, in T3, in T4, in T5, in T6, in T7)
    FixedStringMethods.AppendFormat<T, U, T0, T1, T2, T3, T4, T5, T6, T7, T8>(ref T, in U, in T0, in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8)
    FixedStringMethods.AppendFormat<T, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>(ref T, in U, in T0, in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9)
    FixedStringMethods.AppendFormat<T, U, T0>(ref T, in U, in T0)
    FixedStringMethods.AppendFormat<T, U, T0, T1>(ref T, in U, in T0, in T1)
    FixedStringMethods.AppendFormat<T, U, T0, T1, T2>(ref T, in U, in T0, in T1, in T2)
    FixedStringMethods.AppendFormat<T, U, T0, T1, T2, T3>(ref T, in U, in T0, in T1, in T2, in T3)
    FixedStringMethods.AppendFormat<T, U, T0, T1, T2, T3, T4>(ref T, in U, in T0, in T1, in T2, in T3, in T4)
    FixedStringMethods.AppendFormat<T, U, T0, T1, T2, T3, T4, T5>(ref T, in U, in T0, in T1, in T2, in T3, in T4, in T5)
    FixedStringMethods.AppendFormat<T, U, T0, T1, T2, T3, T4, T5, T6>(ref T, in U, in T0, in T1, in T2, in T3, in T4, in T5, in T6)
    FixedStringMethods.AppendRawByte<T>(ref T, byte)
    FixedStringMethods.Append<T>(ref T, byte*, int)
    FixedStringMethods.Append<T>(ref T, char)
    FixedStringMethods.Append<T>(ref T, int)
    FixedStringMethods.Append<T>(ref T, long)
    FixedStringMethods.Append<T>(ref T, float, char)
    FixedStringMethods.Append<T>(ref T, string)
    FixedStringMethods.Append<T>(ref T, uint)
    FixedStringMethods.Append<T>(ref T, ulong)
    FixedStringMethods.Append<T>(ref T, Unicode.Rune)
    FixedStringMethods.Append<T>(ref T, Unicode.Rune, int)
    FixedStringMethods.Append<T, T2>(ref T, in T2)
    FixedStringMethods.CompareTo<T>(ref T, byte*, int)
    FixedStringMethods.CompareTo<T, T2>(ref T, in T2)
    FixedStringMethods.ComputeHashCode<T>(ref T)
    FixedStringMethods.Contains<T, T2>(ref T, in T2)
    FixedStringMethods.ConvertToString<T>(ref T)
    FixedStringMethods.CopyFromTruncated<T>(ref T, string)
    FixedStringMethods.CopyFromTruncated<T, T2>(ref T, in T2)
    FixedStringMethods.CopyFrom<T>(ref T, string)
    FixedStringMethods.CopyFrom<T, T2>(ref T, in T2)
    FixedStringMethods.EffectiveSizeOf<T>(ref T)
    FixedStringMethods.EndsWith<T>(ref T, Unicode.Rune)
    FixedStringMethods.EndsWith<T, U>(ref T, in U)
    FixedStringMethods.Equals<T>(ref T, byte*, int)
    FixedStringMethods.Equals<T, T2>(ref T, in T2)
    FixedStringMethods.IndexOf<T>(ref T, byte*, int)
    FixedStringMethods.IndexOf<T>(ref T, byte*, int, int, int)
    FixedStringMethods.IndexOf<T>(ref T, Unicode.Rune)
    FixedStringMethods.IndexOf<T, T2>(ref T, in T2)
    FixedStringMethods.IndexOf<T, T2>(ref T, in T2, int, int)
    FixedStringMethods.LastIndexOf<T>(ref T, byte*, int)
    FixedStringMethods.LastIndexOf<T>(ref T, byte*, int, int, int)
    FixedStringMethods.LastIndexOf<T>(ref T, Unicode.Rune)
    FixedStringMethods.LastIndexOf<T, T2>(ref T, in T2)
    FixedStringMethods.LastIndexOf<T, T2>(ref T, in T2, int, int)
    FixedStringMethods.Parse<T>(ref T, ref int, ref int)
    FixedStringMethods.Parse<T>(ref T, ref int, ref float, char)
    FixedStringMethods.Parse<T>(ref T, ref int, ref uint)
    FixedStringMethods.Peek<T>(ref T, int)
    FixedStringMethods.Read<T>(ref T, ref int)
    FixedStringMethods.StartsWith<T>(ref T, Unicode.Rune)
    FixedStringMethods.StartsWith<T, U>(ref T, in U)
    FixedStringMethods.Substring<T>(ref T, int)
    FixedStringMethods.Substring<T>(ref T, int, int)
    FixedStringMethods.ToLowerAscii<T>(ref T)
    FixedStringMethods.ToUpperAscii<T>(ref T)
    FixedStringMethods.TrimEnd<T>(ref T)
    FixedStringMethods.TrimEnd<T>(ref T, ReadOnlySpan<Unicode.Rune>)
    FixedStringMethods.TrimStart<T>(ref T)
    FixedStringMethods.TrimStart<T>(ref T, ReadOnlySpan<Unicode.Rune>)
    FixedStringMethods.Trim<T>(ref T)
    FixedStringMethods.Trim<T>(ref T, ReadOnlySpan<Unicode.Rune>)
    FixedStringMethods.Write<T>(ref T, ref int, Unicode.Rune)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)