StringSearch

StringSearch structure

struct StringSearch (
bool wide_char = false
) {}

Members

Aliases

Char
alias Char = WcharT
Undocumented in source.
Char
alias Char = char
Undocumented in source.
WcharT
alias WcharT = c_stddef.wchar_t
Undocumented in source.
isAlNum
alias isAlNum = c_wctype.iswalnum
Undocumented in source.
isAlNum
alias isAlNum = c_ctype.isalnum
Undocumented in source.
isAlpha
alias isAlpha = c_wctype.iswalpha
Undocumented in source.
isAlpha
alias isAlpha = c_ctype.isalpha
Undocumented in source.
isCntrl
alias isCntrl = c_wctype.iswcntrl
Undocumented in source.
isCntrl
alias isCntrl = c_ctype.iscntrl
Undocumented in source.
isDigit
alias isDigit = c_wctype.iswdigit
Undocumented in source.
isDigit
alias isDigit = c_ctype.isdigit
Undocumented in source.
isGraph
alias isGraph = c_wctype.iswgraph
Undocumented in source.
isGraph
alias isGraph = c_ctype.isgraph
Undocumented in source.
isHexDigit
alias isHexDigit = c_wctype.iswxdigit
Undocumented in source.
isHexDigit
alias isHexDigit = c_ctype.isxdigit
Undocumented in source.
isLower
alias isLower = c_wctype.iswlower
Undocumented in source.
isLower
alias isLower = c_ctype.islower
Undocumented in source.
isPrint
alias isPrint = c_wctype.iswprint
Undocumented in source.
isPrint
alias isPrint = c_ctype.isprint
Undocumented in source.
isPunct
alias isPunct = c_wctype.iswpunct
Undocumented in source.
isPunct
alias isPunct = c_ctype.ispunct
Undocumented in source.
isSpace
alias isSpace = c_wctype.iswspace
Undocumented in source.
isSpace
alias isSpace = c_ctype.isspace
Undocumented in source.
isUpper
alias isUpper = c_wctype.iswupper
Undocumented in source.
isUpper
alias isUpper = c_ctype.isupper
Undocumented in source.
lengthOf
alias lengthOf = c_wchar.wcslen
Undocumented in source.
lengthOf
alias lengthOf = c_string.strlen
Undocumented in source.
pLocateBinChar
alias pLocateBinChar = c_wchar.wmemchr
Undocumented in source.
pLocateBinChar
alias pLocateBinChar = c_string.memchr
Undocumented in source.
pLocateFirstInSet
alias pLocateFirstInSet = c_wchar.wcscspn
Undocumented in source.
pLocateFirstInSet
alias pLocateFirstInSet = c_string.strcspn
Undocumented in source.
pLocatePattern
alias pLocatePattern = c_wchar.wcsstr
Undocumented in source.
pLocatePattern
alias pLocatePattern = c_string.strstr
Undocumented in source.
pMemMove
alias pMemMove = c_wchar.wmemmove
Undocumented in source.
pMemMove
alias pMemMove = c_string.memmove
Undocumented in source.
pSplit
alias pSplit = c_wchar.wcstok
Undocumented in source.
pSplit
alias pSplit = c_string.strtok
Undocumented in source.
strEnsureLower
alias strEnsureLower = charConvDup!(toLower)

Ensures "str" is all lower case, allocates new copy and converts it otherwise.

strIsLower
alias strIsLower = caseCheck!(isLower)

Checks if all letter characters in "str" are lower case.

strIsUpper
alias strIsUpper = caseCheck!(isUpper)

Checks if all letter characters in "str" are upper case.

strToLower
alias strToLower = charConv!(toLower)

Converts "str" in-place to lower case.

strToUpper
alias strToUpper = charConv!(toUpper)

Converts "str" in-place to upper case.

toLower
alias toLower = c_wctype.towlower
Undocumented in source.
toLower
alias toLower = c_ctype.tolower
Undocumented in source.
toUpper
alias toUpper = c_wctype.towupper
Undocumented in source.
toUpper
alias toUpper = c_ctype.toupper
Undocumented in source.

Static functions

appendTerm
bool appendTerm(Char[] str)

Adds a '\0' terminator to "str" if not present.

assertTerm
void assertTerm(Char[] str)

Asserts that "str" is null-terminated.

caseCheck
bool caseCheck(Char[] str)

Tells if all letter characters in "str" match the condition checked by "check". "check" must be something that takes a character in the first argument and returns an integer type where a value different from 0 means that the condition is satisfied.

charConv
Char[] charConv(Char[] str)

Converts each character of str in-place using convert. convert must be a function that takes a character in the first argument and returns the converted character.

charConvDup
const(Char)[] charConvDup(const(Char)[] str)

Checks if all symbols of str are not modified by predicate convert, creates a duplicate otherwise.

containsChar
bool containsChar(Char[] str, Char value, size_t start, size_t length)

Tells whether the first length characters of str, starting fromo start, contain value. If greater, length is truncated to the length of str.

containsChar
bool containsChar(Char[] str, Char value, size_t start)
Undocumented in source. Be warned that the author may not have intended to support it.
containsPattern
bool containsPattern(Char[] str, Char[] pattern, size_t start)

Tells whether str contains pattern

hasTerm
bool hasTerm(Char[] str)

Tells whether "str" is null-terminated.

lengthOf
size_t lengthOf(Char[] str)

Returns the length of "str" without null terminator.

locateChar
size_t locateChar(Char[] str, Char value, size_t start, size_t length)

Locates the first occurence of value within the first length characters of str. If greater, length is truncated to the length of str.

locateChar
size_t locateChar(Char[] str, Char value, size_t start)

Locates the first occurence of value within str.

locateCharSet
size_t locateCharSet(Char[] str, Char[] charset, size_t start)

Locates the first occurrence of any of the characters of charset in str.

locateCharSetT
size_t locateCharSetT(Char[] str, size_t start)

Locates the first occurrence of any of the characters of charset in str. Passing charset as template parameter makes this method somewhat more efficient when used very frequently.

locatePattern
size_t locatePattern(Char[] str, Char[] pattern, size_t start)

Scans "str" for "pattern" and returns the index of the first occurrence if found.

locatePatternT
size_t locatePatternT(Char[] str, size_t start)

Scans "str" for "pattern" and returns the index of the first occurrence if found.

matches
bool matches(Char[] str, Char[] pattern)

Tells whether "str" and "pattern" are equal regardless of null terminators.

shiftString
Char[] shiftString(Char[] str, size_t dst_pos, size_t src_pos, size_t length)

Shifts "length" characters inside "string" from "src_pos" to "dst_pos". This effectively does the same thing as

split
TElem[] split(TElem[] slices, TElem str, Char delim, uint n, bool collapse)

Splits str into at most n slices on each occurrence of delim. collapse indicates whether to collapse consecutive occurrences to a single one to prevent producing empty slices.

split
TElem[] split(TElem[] slices, TElem str, Char[] delims, uint n, bool collapse)

Splits str into at most n slices on each occurrence of any character in delims. collapse indicates whether to collapse consecutive occurrences to a single one to prevent producing empty slices.

splitCollapse
TElem[] splitCollapse(TElem[] slices, TElem str, Char delim, uint n)

Splits str on each occurrence of delim. collapse indicates whether to collapse consecutive occurrences to a single one to prevent producing empty slices.

splitCollapse
TElem[] splitCollapse(TElem[] slices, TElem str, Char[] delim, uint n)

Splits str on each occurrence of any character in delims. collapse indicates whether to collapse consecutive occurrences to a single one to prevent producing empty slices.

stripTerm
bool stripTerm(Char[] str)

Strips the null terminator from str, if any.

trim
TChar[] trim(TChar[] str, bool terminate)

Trims white space from "str".

Static variables

TERM
enum Char TERM;
Undocumented in source.

Templates

LocateDelimDg
template LocateDelimDg(T)

Locate delimiter function definition template. LocateDelimDg is the type of the function callback used by split_().

Meta