Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justcabbage/osu-parser
C++20 Library to parse osu! filetypes
https://github.com/justcabbage/osu-parser
cpp osu osu-libraries osugame parser parsing
Last synced: about 1 month ago
JSON representation
C++20 Library to parse osu! filetypes
- Host: GitHub
- URL: https://github.com/justcabbage/osu-parser
- Owner: JustCabbage
- License: mit
- Created: 2022-08-02T13:20:14.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-22T02:25:44.000Z (over 2 years ago)
- Last Synced: 2023-03-09T07:56:02.307Z (almost 2 years ago)
- Topics: cpp, osu, osu-libraries, osugame, parser, parsing
- Language: C++
- Homepage:
- Size: 18.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# osu!parser [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
### A C++ library to parse osu! filetypes
# Installation
```
git clone --recursive https://github.com/JustCabbage/osu-parser.git
```
## Project Setup
```CMake
target_include_directories(ProjectName PUBLIC osu-parser/include)
```
# Examples:## Database Parsing
```c++
#includeint main()
{
const std::string GamePath = std::string(getenv("localappdata")) + "\\osu!\\";Parser::Database ParsedDatabase(GamePath + "osu!.db");
for(const auto& Beatmap : ParsedDatabase.Beatmaps)
{
std::cout << Beatmap.BeatmapHash << "\n";
}
}
```## Beatmap Parsing
```c++
#includeint main()
{
const std::string SongsPath = std::string(getenv("localappdata")) + "\\osu!\\Songs\\RandomBeatmap\\Beatmap.osu";
Parser::Beatmap ParsedBeatmap(SongsPath);std::cout << "Audio Filename - " << ParsedBeatmap.General.AudioFilename << "\n";
std::cout << "Total Hit Objects - " << ParsedBeatmap.HitObjects.size() << "\n";
std::cout << "Total Timing Points - " << ParsedBeatmap.TimingPoints.size() << "\n";
}
```## Replay Parsing
```c++
#includeint main()
{
const std::string ReplayPath = std::string(std::getenv("localappdata")) + "\\osu!\\Replays\\MyReplay.osr";
Parser::Replay ParsedReplay(ReplayPath);std::cout << "Parsed " << ParsedReplay.Actions.size() << " Replay Actions\n";
std::cout << "Replay Score - " << ParsedReplay.Score << "\n";
}
```# Credits
- [osu!wiki](https://github.com/ppy/osu/wiki/)
- [pocketlzma](https://github.com/SSBMTonberry/pocketlzma)