aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/shirabe-class-map-generator/Cargo.toml8
-rw-r--r--crates/shirabe-class-map-generator/src/file_list.rs19
2 files changed, 27 insertions, 0 deletions
diff --git a/crates/shirabe-class-map-generator/Cargo.toml b/crates/shirabe-class-map-generator/Cargo.toml
new file mode 100644
index 0000000..c913bce
--- /dev/null
+++ b/crates/shirabe-class-map-generator/Cargo.toml
@@ -0,0 +1,8 @@
+[package]
+name = "shirabe-class-map-generator"
+version.workspace = true
+edition.workspace = true
+
+[dependencies]
+shirabe-php-shim.workspace = true
+anyhow.workspace = true
diff --git a/crates/shirabe-class-map-generator/src/file_list.rs b/crates/shirabe-class-map-generator/src/file_list.rs
new file mode 100644
index 0000000..8647dbd
--- /dev/null
+++ b/crates/shirabe-class-map-generator/src/file_list.rs
@@ -0,0 +1,19 @@
+//! 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 add(&mut self, path: String) {
+ self.files.insert(path, true);
+ }
+
+ pub fn contains(&self, path: &str) -> bool {
+ self.files.contains_key(path)
+ }
+}