koto/desktop/config/library.hpp

33 lines
735 B
C++
Raw Normal View History

2024-09-29 17:29:10 +03:00
#pragma once
#include <filesystem>
#include <string>
#include "includes/toml.hpp"
2024-09-29 17:29:10 +03:00
namespace fs = std::filesystem;
enum class KotoLibraryType {
Audiobooks,
Music,
Podcasts,
};
KotoLibraryType libraryTypeFromString(const std::string& type);
std::string libraryTypeToString(KotoLibraryType type);
2024-09-29 17:29:10 +03:00
class KotoLibraryConfig {
public:
KotoLibraryConfig(std::string name, fs::path path, KotoLibraryType type);
KotoLibraryConfig(const toml::value& v);
~KotoLibraryConfig();
std::string getName();
fs::path getPath();
KotoLibraryType getType();
toml::ordered_value serialize();
private:
std::string i_name;
fs::path i_path;
KotoLibraryType i_type;
2024-09-29 17:29:10 +03:00
};