/// <summary> /// Concatenates a pointer onto the current pointer. /// </summary> /// <param name="other">Another pointer.</param> /// <returns>A new pointer.</returns> public JsonPointer Combine(JsonPointer other) { var segments = new PointerSegment[Segments.Length + other.Segments.Length]; Segments.CopyTo(segments, 0); other.Segments.CopyTo(segments, Segments.Length); return(new JsonPointer { Segments = segments, Kind = IsUriEncoded ? JsonPointerKind.UriEncoded : JsonPointerKind.Plain }); }
/// <summary> /// Concatenates additional segments onto the current pointer. /// </summary> /// <param name="additionalSegments">The additional segments.</param> /// <returns>A new pointer.</returns> public JsonPointer Combine(params PointerSegment[] additionalSegments) { var segments = new PointerSegment[Segments.Length + additionalSegments.Length]; Segments.CopyTo(segments, 0); additionalSegments.CopyTo(segments, Segments.Length); return(new JsonPointer { Segments = segments, Kind = IsUriEncoded ? JsonPointerKind.UriEncoded : JsonPointerKind.Plain }); }
public string[] GetSegments() { string[] segmentsCopy = new string[Segments.Length]; Segments.CopyTo(segmentsCopy, 0); return(segmentsCopy); }