forked from AbleOS/ableos_userland
19 lines
370 B
Rust
19 lines
370 B
Rust
|
use alloc::string::{String, ToString};
|
||
|
|
||
|
pub struct Path {
|
||
|
pub path: Vec<String>,
|
||
|
}
|
||
|
impl Path {
|
||
|
pub fn new(path: String) -> Self {
|
||
|
let mut path_vec_string = alloc::vec![];
|
||
|
|
||
|
for part in path.split(&['\\', '/'][..]) {
|
||
|
path_vec_string.push(part.to_string());
|
||
|
}
|
||
|
|
||
|
Path {
|
||
|
path: path_vec_string,
|
||
|
}
|
||
|
}
|
||
|
}
|