dmd.utils

This module defines some utility functions for DMD.

Members

Functions

ensurePathToNameExists
void ensurePathToNameExists(Loc loc, const(char)[] name)

Ensure the root path (the path minus the name) of the provided path exists, and terminate the process if it doesn't.

escapePath
void escapePath(OutBuffer* buf, const(char)* fname)

Takes a path, and escapes '(', ')' and backslashes

parseDigits
bool parseDigits(T val, const(char)[] p, T max)

Convert string to integer.

readFile
Buffer readFile(Loc loc, const(char)* filename)
Buffer readFile(Loc loc, const(char)[] filename)

Reads a file, terminate the program on error

toWinPath
const(char)* toWinPath(const(char)* src)

Normalize path by turning forward slashes into backslashes

writeEscapedMakePath
void writeEscapedMakePath(OutBuffer buf, const(char)* fname)

Takes a path, and make it compatible with GNU Makefile format.

writeFile
void writeFile(Loc loc, const(char)[] filename, void[] data)

Writes a file, terminate the program on error

Meta