Crates.io | osu-file-parser |
lib.rs | osu-file-parser |
version | 1.1.0 |
source | src |
created_at | 2022-08-29 15:01:08.95132 |
updated_at | 2022-08-29 20:51:29.315464 |
description | A crate to parse an osu! beatmap file |
homepage | |
repository | https://github.com/Eddio0141/osu-file-parser |
max_upload_size | |
id | 654549 |
size | 9,203,473 |
A crate to parse an osu! beatmap file.
use osu_file_parser::*;
let osu_file_str = include_str!("./tests/osu_files/files/acid_rain.osu");
// parse the .osu file
let mut osu_file = osu_file_str.parse::<OsuFile>().unwrap();
let osb_str = include_str!("./tests/osu_files/files/acid_rain.osb");
// .osb file can also be parsed and appended to the `OsuFile` instance
osu_file.append_osb(osb_str).unwrap();
// you can use `assert_eq_osu_str` to assert that the parsed .osu file is equal to the original .osu file
assert_eq_osu_str(&osu_file.to_string(), osu_file_str);
assert_eq_osu_str(&osu_file.osb_to_string().unwrap(), osb_str);
VersionedToString
, VersionedFromStr
and VersionedDefault
traits as replacements for the Display
, FromStr
and Default
traits.version
parameter to choose what version output to use.None
.Error
in those cases.Error
has methods that tells you where the error happened in the input string and what the error was.