mirror of
https://github.com/mbierlee/mirage-config.git
synced 2024-11-15 04:44:01 +01:00
Add java load aliases for the unaware
This commit is contained in:
parent
9eac0515a1
commit
6661ef73b4
1
TODO.md
1
TODO.md
|
@ -14,3 +14,4 @@
|
||||||
- Case insensitive properties and sections
|
- Case insensitive properties and sections
|
||||||
- Escape characters
|
- Escape characters
|
||||||
- Support multi-line values with backslash
|
- Support multi-line values with backslash
|
||||||
|
- Example
|
||||||
|
|
|
@ -46,6 +46,9 @@ ConfigDictionary parseJavaProperties(const string properties) {
|
||||||
return new JavaPropertiesFactory().parseConfig(properties);
|
return new JavaPropertiesFactory().parseConfig(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// ditto
|
||||||
|
alias parseJavaConfig = parseJavaProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load a Java properties file from disk.
|
* Load a Java properties file from disk.
|
||||||
*
|
*
|
||||||
|
@ -57,6 +60,9 @@ ConfigDictionary loadJavaProperties(const string filePath) {
|
||||||
return new JavaPropertiesFactory().loadFile(filePath);
|
return new JavaPropertiesFactory().loadFile(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// ditto
|
||||||
|
alias loadJavaConfig = loadJavaProperties;
|
||||||
|
|
||||||
version (unittest) {
|
version (unittest) {
|
||||||
import std.exception : assertThrown;
|
import std.exception : assertThrown;
|
||||||
import std.process : environment;
|
import std.process : environment;
|
||||||
|
@ -108,7 +114,7 @@ version (unittest) {
|
||||||
|
|
||||||
@("Values and keys are trimmed")
|
@("Values and keys are trimmed")
|
||||||
unittest {
|
unittest {
|
||||||
auto config = parseJavaProperties("
|
auto config = parseJavaConfig("
|
||||||
one = money
|
one = money
|
||||||
");
|
");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue