docs.unity3d.com
    Show / Hide Table of Contents

    Struct ParseSegment

    Structure used in parsing strings. Contains offset and length.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.Logging
    Syntax
    public struct ParseSegment

    Fields

    Length

    Length of the segment

    Declaration
    public int Length
    Field Value
    Type Description
    Int32

    Offset

    Start of the segment

    Declaration
    public int Offset
    Field Value
    Type Description
    Int32

    Properties

    IsValid

    Is this segment contains anything, or was initialized

    Declaration
    public readonly bool IsValid { get; }
    Property Value
    Type Description
    Boolean

    OffsetEnd

    End of the segment

    Declaration
    public readonly int OffsetEnd { get; }
    Property Value
    Type Description
    Int32

    Methods

    LeftPart(in ParseSegment, Int32)

    Cut segment from the left

    Declaration
    public static ParseSegment LeftPart(in ParseSegment origin, int splitPoint)
    Parameters
    Type Name Description
    ParseSegment origin

    Original segment

    Int32 splitPoint

    Split point inside the segment

    Returns
    Type Description
    ParseSegment

    New segment [origin.Offset..splitPoint)

    Local(in ParseSegment, in ParseSegment)

    Create local segment in parent's space

    Declaration
    public static ParseSegment Local(in ParseSegment parent, in ParseSegment convertThis)
    Parameters
    Type Name Description
    ParseSegment parent

    Parent

    ParseSegment convertThis

    Segment to convert

    Returns
    Type Description
    ParseSegment

    Same as convertThis, but offset is in parent's offset space

    Reduce(in ParseSegment, Int32, Int32)

    Reduce the ParseSegment by amount of bytes from the left and right

    Declaration
    public static ParseSegment Reduce(in ParseSegment origin, int bytesFromLeft, int bytesFromRight)
    Parameters
    Type Name Description
    ParseSegment origin

    Original segment

    Int32 bytesFromLeft

    Amount to bytes to reduce from the left

    Int32 bytesFromRight

    Amount to bytes to reduce from the right

    Returns
    Type Description
    ParseSegment

    New reduced segment

    RightPart(in ParseSegment, Int32)

    Cut segment from the right

    Declaration
    public static ParseSegment RightPart(in ParseSegment origin, int splitPoint)
    Parameters
    Type Name Description
    ParseSegment origin

    Original segment

    Int32 splitPoint

    Split point inside the segment

    Returns
    Type Description
    ParseSegment

    New segment [splitPoint..original_end]

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023