iii

介绍

SImple config file for lib

配置文件格式

default.iii

~~~ c1 = value

2222

c2 = value2 c3 = ccc3 c5 = 5c ~~~

创建新的配置文件

~~~rust let mut cc = BufData::new(); cc.chgvalue("c1", "value"); cc.chgvalue("c2", "value2"); cc.chgvalue("c3", "value3"); if let Ok(_) = cc.write(None){ println!("file write success") }; ~~~

读取配置文件并写入

~~~rust let mut cc = BufData::Loadfromiii("default.iii"); cc.chgvalue("c3", "ccc3"); cc.chgvalue("c5", "5c"); if let Ok(_) = cc.write(None){ println!("file write success") }; ~~~

读取键值

~~~rust let mut cc = BufData::Loadfromiii("default.iii"); if let Some(v) = cc.getvalue("c2"){ println!("K:{},V:{}","c2",v); } if let Some(v) = cc.getvalue("c5"){ println!("K:{},V:{}","c5",v); } ~~~