parin.joka.configs
The configs module includes build and configuration file helpers.
Functions 8
fn
IStr buildInfo(IStr path = defaultBuildInfoPath)(IStr key)Returns the value associated with a key from a build info file. The file uses the format: "key: value" Returns an empty string if the key is not found. Example: `buildInfo("version")` returns `"1.0...fn
T buildInfoStruct(T, IStr path = defaultBuildInfoPath)()Returns the structure associated with a build info file. The file uses the format: "key: value" Example: `buildInfoStruct!MyInfo()`fn
bool buildInfoLineHasKey(IStr line, IStr key) @safe nothrow @nogcReturns true if a build info line starts with the given key. The line uses the format: "key: value" Example: `buildInfoLineHasKey("version: 1.0.0", "version")` returns `true`.fn
IStr buildInfoLineHeader(IStr line) @safe nothrow @nogcReturns the section name from a build info header line like `[window]`, or an empty string if the line is not a header. Example: `buildInfoLineHeader("[window]")` returns `"window"`.fn
IStr buildInfoFromLine(IStr line, Sz keyLength = 0) @safe nothrow @nogcReturns the value associated with a key from a build info line. The line uses the format: "key: value" Returns an empty string if the line is invalid. Example: `buildInfoFromLine("version: 1.0.0")`...fn
IStr buildInfoFromContent(IStr content, IStr key) @safe nothrow @nogcReturns the value associated with a key from a build info string. The lines of the string use the format: "key: value" Returns an empty string if the key is not found. Example: `buildInfoFromConten...fn
bool parseBuildInfoValue(T)(IStr value, ref T field)Parses a build info value string into a field. Returns false on success and true if the field type is not supported. Example: `parseBuildInfoValue("69", info.age)` sets `info.age` to `69`.fn
void parseBuildInfo(T)(IStr content, ref T info) if (is(T == struct)) @trustedParses a build info string into a struct by matching field names to keys. The lines of the string use the format: "key: value" Supports bool, integer, floating point, and string fields. Example: `p...Variables 3
enumvar
defaultBuildInfoSep = ':'The separator character used in build info files.
enumvar
defaultBuildInfoSepStr = ":"The separator string used in build info files.
enumvar
defaultBuildInfoPath = "build_info.txt"The default path to the build info file.