Crates.io | usdx_parser |
lib.rs | usdx_parser |
version | 0.2.2 |
source | src |
created_at | 2022-04-03 09:32:05.968951 |
updated_at | 2022-04-07 21:29:20.563742 |
description | Parser for UltraStar Deluxe song files. |
homepage | |
repository | https://github.com/MGlolenstine/usdx_parser.git |
max_upload_size | |
id | 561241 |
size | 16,671 |
This is a rust parser for USDX song files. Files are written as a plaintext files that contain data about the song and notes/lyrics.
Direct read from a file:
let song = Song::from_file("tests/test.txt").unwrap();
dbg!(song);
Read from a &str
:
let text = std::fs::read_to_string("tests/test.txt").unwrap();
let song = Song::from_str(&text).unwrap();
dbg!(song);
Parse directly from String:
let text = r#"
#ARTIST:Three Days Grace
#TITLE:I Hate Everything About You
#MP3:i_hate_everything_about_you.ogg
#LANGUAGE:English
#BPM:100
#GAP:100
"#;
let song: Song = text.to_string().into();
dbg!(song);