修改该了关于info信息为json内部管理 该项目只适用于windows或linux 修改了c++及相应的rust代码 不适用于arm

This commit is contained in:
xin
2025-06-27 15:46:42 +08:00
parent ae30c24a8f
commit 613a219a49
8 changed files with 215 additions and 19 deletions

View File

@ -102,7 +102,7 @@ pub fn read_iris_file(path: &str) -> Result<OneIRISData> {
reader.read_exact(&mut tempvector)?;
// Convert to String
let json_string = String::from_utf8(tempvector).unwrap_or_default();
let json_string = json_string.trim_end_matches('\0').to_string();
//let json_string = json_string.trim_end_matches('\0').to_string();
//print!("JSON String: {}", json_string);
let json:Value = match serde_json::from_str(&json_string){
Ok(json) => json,
@ -160,6 +160,7 @@ pub fn read_iris_file(path: &str) -> Result<OneIRISData> {
} */
//如果info_type是infolist 则需要逐个解析
if json.get("info_type").and_then(Value::as_str) == Some("infolist") {
//println!("Found infolist type JSON: {}", json);
let info_number = json.get("info_number").and_then(Value::as_u64).unwrap_or(0) as usize;
for i in 0 ..info_number{
//将对应的info加入到data中