#toolbox #config-file #path

tanzhenhui_code_lib

toolbox for my own

47 releases (5 breaking)

0.6.1 Sep 23, 2024
0.5.9 Sep 23, 2024
0.4.11 Sep 18, 2024
0.3.14 Sep 14, 2024
0.1.0 Sep 11, 2024

#718 in Filesystem

Download history 262/week @ 2024-09-05 1381/week @ 2024-09-12 1364/week @ 2024-09-19 365/week @ 2024-09-26 96/week @ 2024-10-03

3,468 downloads per month

MIT license

17KB
302 lines

ini_helper

implement example:

use tanzhenhui_code_lib::generate_get_ini_info;
generate_get_ini_info!(bz_dir, input_dir, output_dir, password);

this will read a file named "config.ini" in the same path of your program. in this example,the file will be like this:

config.ini

[common]

  • bz_dir = D:\tool\Bandizip\bz.exe
  • input_dir = D:\BaiduNetdiskDownload\
  • output_dir = D:\BaiduNetdiskDownload\output
  • password = 这是一个中文密码

you can get the info in the other place of your code like this:

use_example:

        let IniInfo {
            bz_dir,
            input_dir,
            output_dir,
            password,
        } = get_ini_info();

and you get four String variable in your code

Dependencies

~6–17MB
~299K SLoC