aboutsummaryrefslogtreecommitdiff
path: root/src/filecache.rs
blob: 5e9d324f68ad46777231919da50e0106e942c9a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::vector::FileVector;

pub struct FileCache {
    pub vector : FileVector,
    pub path : String,
}

impl FileCache {
    pub fn from_line(line : String) -> Self {
        let ls : Vec<String> = line.split(',').map(|s| s.to_string()).collect();
        let v = FileVector::from_string(ls[1].clone());
        let p = ls[0].clone().replace("\0", ",");
        Self {
            vector : v,
            path : p
        }
    }
}