{!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 NativeText | Collections | 2.3.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct NativeText

    An unmanaged, mutable, resizable UTF-8 string.

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

    The string is always null-terminated, meaning a zero byte always immediately follows the last character.

    Constructors

    Name Description
    NativeText(int, Allocator)

    Initializes and returns an instance of NativeText.

    NativeText(int, AllocatorHandle)

    Initializes and returns an instance of NativeText.

    NativeText(string, Allocator)

    Initializes and returns an instance of NativeText with the characters copied from another string.

    NativeText(string, AllocatorHandle)

    Initializes and returns an instance of NativeText with the characters copied from another string.

    NativeText(Allocator)

    Initializes and returns an instance of NativeText with an initial capacity of 512 bytes.

    NativeText(AllocatorHandle)

    Initializes and returns an instance of NativeText with an initial capacity of 512 bytes.

    NativeText(in FixedString128Bytes, Allocator)

    Initializes and returns an instance of NativeText with the characters copied from another string.

    NativeText(in FixedString128Bytes, AllocatorHandle)

    Initializes and returns an instance of NativeText with the characters copied from another string.

    NativeText(in FixedString32Bytes, Allocator)

    Initializes and returns an instance of NativeText with the characters copied from another string.

    NativeText(in FixedString32Bytes, AllocatorHandle)

    Initializes and returns an instance of NativeText with the characters copied from another string.

    NativeText(in FixedString4096Bytes, Allocator)

    Initializes and returns an instance of NativeText with the characters copied from another string.

    NativeText(in FixedString4096Bytes, AllocatorHandle)

    Initializes and returns an instance of NativeText with the characters copied from another string.

    NativeText(in FixedString512Bytes, Allocator)

    Initializes and returns an instance of NativeText with the characters copied from another string.

    NativeText(in FixedString512Bytes, AllocatorHandle)

    Initializes and returns an instance of NativeText with the characters copied from another string.

    NativeText(in FixedString64Bytes, Allocator)

    Initializes and returns an instance of NativeText with the characters copied from another string.

    NativeText(in FixedString64Bytes, AllocatorHandle)

    Initializes and returns an instance of NativeText with the characters copied from another string.

    Properties

    Name Description
    Capacity

    The current capacity in bytes of this string.

    IsCreated

    Whether this string's character buffer has been allocated (and not yet deallocated).

    IsEmpty

    Whether this string has no characters.

    this[int]

    The byte at an index. Note that writing to a NativeText.Readonly is not supported; the setter of this property throws when safety checks are enabled.

    Length

    The current length in bytes of this string.

    Methods

    Name Description
    Add(in byte)

    Appends a byte.

    AsReadOnly()

    Returns a readonly version of this NativeText instance.

    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.

    CompareTo(NativeText)

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

    CompareTo(ReadOnly)

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

    Dispose()

    Releases all resources (memory and safety handles).

    Dispose(JobHandle)

    Creates and schedules a job that releases all resources (memory and safety handles) of this NativeText.

    ElementAt(int)

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

    Equals(object)

    Returns true if this string and another object are equal.

    Equals(string)

    Returns true if this string and another are equal.

    Equals(FixedString128Bytes)

    Returns true if this string and another are equal.

    Equals(FixedString32Bytes)

    Returns true if this string and another are equal.

    Equals(FixedString4096Bytes)

    Returns true if this string and another are equal.

    Equals(FixedString512Bytes)

    Returns true if this string and another are equal.

    Equals(FixedString64Bytes)

    Returns true if this string and another are equal.

    Equals(NativeText)

    Returns true if this string and another are equal.

    Equals(ReadOnly)

    Returns true if this string and another are equal.

    GetEnumerator()

    Returns an enumerator for iterating over the characters of the NativeText.

    GetHashCode()

    Returns a hash code of this string.

    GetUnsafePtr()

    Returns a pointer to this string's character buffer.

    ToString()

    Returns a managed string copy of this string.

    TryResize(int, NativeArrayOptions)

    Attempt to set the length in bytes of this string.

    Operators

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

    Returns true if two strings are equal.

    operator ==(in NativeText, in FixedString32Bytes)

    Returns true if two strings are equal.

    operator ==(in NativeText, in FixedString4096Bytes)

    Returns true if two strings are equal.

    operator ==(in NativeText, in FixedString512Bytes)

    Returns true if two strings are equal.

    operator ==(in NativeText, in FixedString64Bytes)

    Returns true if two strings are equal.

    operator !=(in NativeText, in FixedString128Bytes)

    Returns true if two strings are unequal.

    operator !=(in NativeText, in FixedString32Bytes)

    Returns true if two strings are unequal.

    operator !=(in NativeText, in FixedString4096Bytes)

    Returns true if two strings are unequal.

    operator !=(in NativeText, in FixedString512Bytes)

    Returns true if two strings are unequal.

    operator !=(in NativeText, in FixedString64Bytes)

    Returns true if two strings 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(ref NativeText, int)
    FixedStringMethods.Substring(ref NativeText, int, int)
    FixedStringMethods.Substring(ref NativeText, int, int, AllocatorManager.AllocatorHandle)
    FixedStringMethods.Substring(ref NativeText, int, AllocatorManager.AllocatorHandle)
    FixedStringMethods.Substring<T>(ref T, int)
    FixedStringMethods.Substring<T>(ref T, int, int)
    FixedStringMethods.ToLowerAscii(ref NativeText, AllocatorManager.AllocatorHandle)
    FixedStringMethods.ToLowerAscii<T>(ref T)
    FixedStringMethods.ToUpperAscii(ref NativeText, AllocatorManager.AllocatorHandle)
    FixedStringMethods.ToUpperAscii<T>(ref T)
    FixedStringMethods.Trim(ref NativeText, AllocatorManager.AllocatorHandle)
    FixedStringMethods.Trim(ref NativeText, AllocatorManager.AllocatorHandle, ReadOnlySpan<Unicode.Rune>)
    FixedStringMethods.TrimEnd(ref NativeText, AllocatorManager.AllocatorHandle)
    FixedStringMethods.TrimEnd(ref NativeText, AllocatorManager.AllocatorHandle, ReadOnlySpan<Unicode.Rune>)
    FixedStringMethods.TrimEnd<T>(ref T)
    FixedStringMethods.TrimEnd<T>(ref T, ReadOnlySpan<Unicode.Rune>)
    FixedStringMethods.TrimStart(ref NativeText, AllocatorManager.AllocatorHandle)
    FixedStringMethods.TrimStart(ref NativeText, AllocatorManager.AllocatorHandle, 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)