Table of Contents

Class SpanExtensions

Namespace
CarinaStudio
Assembly
CarinaStudio.AppBase.Core.dll

Extensions for Span<T> and ReadOnlySpan<T>.

public static class SpanExtensions
Inheritance
SpanExtensions
Inherited Members

Methods

IsEmptyOrWhiteSpace(ReadOnlySpan<char>)

Check whether given character sequence is empty or contains whitespaces only or not.

public static bool IsEmptyOrWhiteSpace(this ReadOnlySpan<char> s)

Parameters

s ReadOnlySpan<char>

Character sequence to check.

Returns

bool

True if the character sequence is empty or contains whitespaces only.

IsEmptyOrWhiteSpace(Span<char>)

Check whether given character sequence is empty or contains whitespaces only or not.

public static bool IsEmptyOrWhiteSpace(this Span<char> s)

Parameters

s Span<char>

Character sequence to check.

Returns

bool

True if the character sequence is empty or contains whitespaces only.

IsNotEmpty<T>(ReadOnlySpan<T>)

Check whether given ReadOnlySpan<T> contains data or not.

public static bool IsNotEmpty<T>(this ReadOnlySpan<T> span)

Parameters

span ReadOnlySpan<T>

ReadOnlySpan<T> to check.

Returns

bool

True if ReadOnlySpan<T> contains data.

Type Parameters

T

Type of value.

IsNotEmpty<T>(Span<T>)

Check whether given Span<T> contains data or not.

public static bool IsNotEmpty<T>(this Span<T> span)

Parameters

span Span<T>

Span<T> to check.

Returns

bool

True if Span<T> contains data.

Type Parameters

T

Type of value.

IsNotWhiteSpace(ReadOnlySpan<char>)

Check whether given character sequence contains at least one non-whitespace or not.

public static bool IsNotWhiteSpace(this ReadOnlySpan<char> s)

Parameters

s ReadOnlySpan<char>

Character sequence to check.

Returns

bool

True if the character sequence contains contains at least one non-whitespace.

IsNotWhiteSpace(Span<char>)

Check whether given character sequence contains at least one non-whitespace or not.

public static bool IsNotWhiteSpace(this Span<char> s)

Parameters

s Span<char>

Character sequence to check.

Returns

bool

True if the character sequence contains contains at least one non-whitespace.

PinAs<T>(Span<T>, PointerAction<T>)

Get address of value referenced by Span<T> and perform an action.

public static void PinAs<T>(this Span<T> span, PointerAction<T> action) where T : unmanaged

Parameters

span Span<T>

Span<T>.

action PointerAction<T>

Action to perform.

Type Parameters

T

Type of value.

Pin<T>(ReadOnlySpan<T>, PointerAction<T>)

Get address of value referenced by ReadOnlySpan<T> and perform an action.

public static void Pin<T>(this ReadOnlySpan<T> span, PointerAction<T> action) where T : unmanaged

Parameters

span ReadOnlySpan<T>

ReadOnlySpan<T>.

action PointerAction<T>

Action to perform.

Type Parameters

T

Type of value.

Pin<T>(ReadOnlySpan<T>, Action<IntPtr, int>)

Get address of value referenced by ReadOnlySpan<T> and perform an action.

public static void Pin<T>(this ReadOnlySpan<T> span, Action<IntPtr, int> action) where T : unmanaged

Parameters

span ReadOnlySpan<T>

ReadOnlySpan<T>.

action Action<IntPtr, int>

Action to perform.

Type Parameters

T

Type of value.

Pin<T>(ReadOnlySpan<T>, Action<IntPtr>)

Get address of value referenced by ReadOnlySpan<T> and perform an action.

public static void Pin<T>(this ReadOnlySpan<T> span, Action<IntPtr> action) where T : unmanaged

Parameters

span ReadOnlySpan<T>

ReadOnlySpan<T>.

action Action<IntPtr>

Action to perform.

Type Parameters

T

Type of value.

Pin<T>(Span<T>, Action<IntPtr, int>)

Get address of value referenced by Span<T> and perform an action.

public static void Pin<T>(this Span<T> span, Action<IntPtr, int> action) where T : unmanaged

Parameters

span Span<T>

Span<T>.

action Action<IntPtr, int>

Action to perform.

Type Parameters

T

Type of value.

Pin<T>(Span<T>, Action<IntPtr>)

Get address of value referenced by Span<T> and perform an action.

public static void Pin<T>(this Span<T> span, Action<IntPtr> action) where T : unmanaged

Parameters

span Span<T>

Span<T>.

action Action<IntPtr>

Action to perform.

Type Parameters

T

Type of value.

Pin<T, R>(ReadOnlySpan<T>, PointerInFunc<T, R>)

Get address of value referenced by ReadOnlySpan<T> and generate value.

public static R Pin<T, R>(this ReadOnlySpan<T> span, PointerInFunc<T, R> func) where T : unmanaged

Parameters

span ReadOnlySpan<T>

ReadOnlySpan<T>.

func PointerInFunc<T, R>

Function to generate value.

Returns

R

Generated value.

Type Parameters

T

Type of value.

R

Type of generated value.

Pin<T, R>(ReadOnlySpan<T>, Func<IntPtr, int, R>)

Get address of value referenced by ReadOnlySpan<T> and generate value.

public static R Pin<T, R>(this ReadOnlySpan<T> span, Func<IntPtr, int, R> func) where T : unmanaged

Parameters

span ReadOnlySpan<T>

ReadOnlySpan<T>.

func Func<IntPtr, int, R>

Function to generate value.

Returns

R

Generated value.

Type Parameters

T

Type of value.

R

Type of generated value.

Pin<T, R>(ReadOnlySpan<T>, Func<IntPtr, R>)

Get address of value referenced by ReadOnlySpan<T> and generate value.

public static R Pin<T, R>(this ReadOnlySpan<T> span, Func<IntPtr, R> func) where T : unmanaged

Parameters

span ReadOnlySpan<T>

ReadOnlySpan<T>.

func Func<IntPtr, R>

Function to generate value.

Returns

R

Generated value.

Type Parameters

T

Type of value.

R

Type of generated value.

Pin<T, R>(Span<T>, PointerInFunc<T, R>)

Get address of value referenced by Span<T> and generate value.

public static R Pin<T, R>(this Span<T> span, PointerInFunc<T, R> func) where T : unmanaged

Parameters

span Span<T>

Span<T>.

func PointerInFunc<T, R>

Function to generate value.

Returns

R

Generated value.

Type Parameters

T

Type of value.

R

Type of generated value.

Pin<T, R>(Span<T>, Func<IntPtr, int, R>)

Get address of value referenced by Span<T> and generate value.

public static R Pin<T, R>(this Span<T> span, Func<IntPtr, int, R> func) where T : unmanaged

Parameters

span Span<T>

Span<T>.

func Func<IntPtr, int, R>

Function to generate value.

Returns

R

Generated value.

Type Parameters

T

Type of value.

R

Type of generated value.

Pin<T, R>(Span<T>, Func<IntPtr, R>)

Get address of value referenced by Span<T> and generate value.

public static R Pin<T, R>(this Span<T> span, Func<IntPtr, R> func) where T : unmanaged

Parameters

span Span<T>

Span<T>.

func Func<IntPtr, R>

Function to generate value.

Returns

R

Generated value.

Type Parameters

T

Type of value.

R

Type of generated value.