dparsergen.core.utils

Undocumented in source.

Members

Classes

TodoList
class TodoList(K)

Helper for list of todo items, which can be added while iterating.

Functions

addOnce
bool addOnce(T[] dst, T[] src)
bool addOnce(T[] dst, T s)

Adds elements to dst, which are not already in dst.

byUnescapedDchar
auto byUnescapedDchar(R range)

Iterate string by unescaped character.

codepointSetFromStr
CodepointSet codepointSetFromStr(string spec)

Parse representation of codepoint set.

escapeChar
string escapeChar(dchar c, bool alwaysEscape)

Escapes character c for use in a D string literal.

escapeCodePoint
string escapeCodePoint(uint codepoint, bool inSet)

Escape codepoint.

escapeD
string escapeD(const(char)[] s)

Escapes every character in s for use in a D string literal.

escapeHTML
string escapeHTML(const(char)[] s)

Escape string for HTML.

flagsToString
string flagsToString(E e)

Convert enum to string by interpreting the members as flags.

inCharSet
bool inCharSet(dchar c)

Check if character c belongs to the set specified by spec. See codepointSetFromStr for the syntax of spec.

memberOrDefault
auto memberOrDefault(T obj)

Returns member of object, which is not null, and the default value for null objects.

repeatChar
string repeatChar(size_t num)
Undocumented in source. Be warned that the author may not have intended to support it.
sortedKeys
K[] sortedKeys(V[K] aa)
const(K)[] sortedKeys(V[K] aa)

Generates sorted array of all keys in associative array.

toDStringLiteral
string toDStringLiteral(const(char)[] s)

Generates a D string literal for s.

Structs

SimpleArrayAllocator
struct SimpleArrayAllocator(T, size_t blockSize = 4 * 1024 - 32)

Allocator for array, which is used internally for temporary data.

UnescapedChar
struct UnescapedChar

Unescaped character.

Templates

AliasSeqIf
template AliasSeqIf(bool b, T...)

Creates an alias sequence containing T if b is true. An empty alias sequence is created otherwise.

arrayToAliasSeq
template arrayToAliasSeq(alias a)

Creates an alias sequence with all members of array a.

Meta