parin.joka.configs

The configs module includes build and configuration file helpers.

Functions 8

fnIStr 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...
fnT buildInfoStruct(T, IStr path = defaultBuildInfoPath)()Returns the structure associated with a build info file. The file uses the format: "key: value" Example: `buildInfoStruct!MyInfo()`
fnbool 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`.
fnIStr 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"`.
fnIStr 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")`...
fnIStr 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...
fnbool 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`.
fnvoid 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

enumvardefaultBuildInfoSep = ':'

The separator character used in build info files.

enumvardefaultBuildInfoSepStr = ":"

The separator string used in build info files.

enumvardefaultBuildInfoPath = "build_info.txt"

The default path to the build info file.