dmd.common.string

Common string functions including filename manipulation.

Members

Functions

asDString
auto asDString(C* stringz)

Converts a zero-terminated C string to a D slice. Takes linear time and allocates no memory.

extendedPathThen
auto extendedPathThen(const(char)[] path)

Converts a path to one suitable to be passed to Win32 API functions that can deal with paths longer than 248 characters then calls the supplied function on it.

toWStringz
wchar[] toWStringz(const(char)[] narrow, SmallBuffer!wchar buffer)

(Windows only) Converts a narrow string to a wide string using buffer as strorage. Returns a slice managed by buffer containing the converted string. The terminating zero is not part of the returned slice, but is guaranteed to follow it.

Structs

SmallBuffer
struct SmallBuffer(Element)

Defines a temporary array of Elements using a fixed-length buffer as back store. If the length of the buffer suffices, it is readily used. Otherwise, malloc is used to allocate memory for the array and free is used for deallocation in the destructor.

Meta