fixedTermStrCmp

Compares a string of unknown length against a statically known key.

This function also handles escapes and requires one or more terminator chars.

@nogc nothrow
int
fixedTermStrCmp
(
C
immutable C[] key
immutable C[] terminators
immutable C[] special = null
)
(
ref const(C)* p_str
,
scope bool delegate
(
ref immutable(char)*
,
ref const(char)*
)
callback = null
)

Parameters

C

Character with.

key

The static key string.

terminators

A list of code units that terminate the string.

special

A list of code units that are handled by the user callback. Use this for escape string handling. Default is null.

p_str const(C)*

Pointer to the string for the comparison. After the function call it will be behind the last matching character.

callback bool delegate
(
ref immutable(char)*
,
ref const(char)*
)

User callback to handle special escape characters if special is non-empty.

Return Value

Type: int

A code with following meanings: -1 = not equal, terminator character hit, 0 = not equal, but string not exhausted, 1 = string equals key.

Meta