-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod create; | ||
pub mod extract; | ||
pub mod list; | ||
pub mod metadata; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use corelib::{archive::{self, EntrySource}, file::FsFile, formats}; | ||
|
||
pub fn create( | ||
format: String, | ||
input: String, | ||
output: String, | ||
buffer_size: u64, | ||
) { | ||
let files: Vec<EntrySource> = input.split(';').map(|file| { | ||
let file = file.split(':').collect::<Vec<&str>>(); | ||
let source_path = file.get(0).unwrap(); | ||
let mut target_path = source_path; | ||
match file.get(1) { | ||
Some(path) => { | ||
target_path = path; | ||
} | ||
None => {} | ||
} | ||
EntrySource { | ||
path: target_path.to_string(), | ||
source: FsFile::new(&source_path.to_string()), | ||
} | ||
}).collect(); | ||
archive::create( | ||
formats::from_string(&format), | ||
output, | ||
files, | ||
buffer_size, | ||
) | ||
.unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters