dotecnf 0.1.1

loader for ".ecnf" file such as ".env". ".ecnf" is key-value setting file with key's hierarchy.
Documentation
  • Coverage
  • 46.15%
    6 out of 13 items documented0 out of 0 items with examples
  • Size
  • Source code size: 24.51 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.53 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ogata-k

dotecnf

What is .ecnf

".ecnf" is "Environment CoNFig" file such as ".env" file. .env is simple key-value store. So .enc cannot treat "key = {key = value}" and "key="(value is null). It is not useful. .ecnf is my original formatting file. .ecnf can treat them which .env cannot treat. .ecnf has following format.

# comment
# null (None)
ONLY_UPPER_START :

# empty string
EMPTY: ""

# not empty string
NOT_EMPTY :"value"

# fail
# sTart: 
# _START :""

ZERO : {
    FIRST : ""
    SECOND: {
        THIRD: "日本語"
    }
    FOURTH :
}

SUCCESS: {
}

# ERROR: {}

usage

// init
let mut loader = ECnfLoader::new();

// load: self.from<R: Read>(R), self.load_from_file(&Path), self.load_from_str(&str))
loader.load_from_str(input);

let ecnf: HashMap<String, Option<String>> = loader.build_ecnf();
// use ecnf...