aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-class-map-generator/src/file_list.rs
blob: 0813f2c1ec1a0b11979e9cf1554f4183ce42d425 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//! ref: composer/vendor/composer/class-map-generator/src/FileList.php

use indexmap::IndexMap;

/// Contains a list of files which were scanned to generate a classmap
#[derive(Debug)]
pub struct FileList {
    pub files: IndexMap<String, bool>,
}

impl FileList {
    pub fn new() -> Self {
        FileList {
            files: IndexMap::new(),
        }
    }

    pub fn add(&mut self, path: String) {
        self.files.insert(path, true);
    }

    pub fn contains(&self, path: &str) -> bool {
        self.files.contains_key(path)
    }
}