Tidied up code, going to put up the coding convention later on
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#ifndef ALBUMMANAGER_H_
|
||||
#define ALBUMMANAGER_H_
|
||||
|
||||
#include "model/Models.h"
|
||||
|
||||
namespace manager
|
||||
{
|
||||
class AlbumManager
|
||||
{
|
||||
public:
|
||||
AlbumManager(const model::BinaryPath&);
|
||||
|
||||
model::Album retrieveAlbum(model::Album&);
|
||||
model::Album saveAlbum(const model::Song&);
|
||||
|
||||
static void printAlbum(const model::Album&);
|
||||
private:
|
||||
model::BinaryPath m_bConf;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef ARTISTMANAGER_H_
|
||||
#define ARTISTMANAGER_H_
|
||||
|
||||
#include "model/Models.h"
|
||||
|
||||
namespace manager
|
||||
{
|
||||
class ArtistManager
|
||||
{
|
||||
public:
|
||||
ArtistManager(const model::BinaryPath&);
|
||||
|
||||
model::Artist retrieveArtist(model::Artist&);
|
||||
model::Artist saveArtist(const model::Song&);
|
||||
|
||||
static void printArtist(const model::Artist&);
|
||||
private:
|
||||
model::BinaryPath m_bConf;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef COVERARTMANAGER_H_
|
||||
#define COVERARTMANAGER_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "model/Models.h"
|
||||
|
||||
namespace manager
|
||||
{
|
||||
class CoverArtManager
|
||||
{
|
||||
public:
|
||||
CoverArtManager(const std::string&);
|
||||
CoverArtManager(const model::BinaryPath& bConf);
|
||||
|
||||
model::Cover saveCover(const model::Song&, std::string&, const std::string&);
|
||||
private:
|
||||
model::BinaryPath m_bConf;
|
||||
std::string path;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef DIRECTORY_MANAGER_H_
|
||||
#define DIRECTORY_MANAGER_H_
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "model/Models.h"
|
||||
|
||||
namespace manager
|
||||
{
|
||||
class DirectoryManager
|
||||
{
|
||||
public:
|
||||
static std::string createDirectoryProcess(model::Song, const std::string&);
|
||||
static std::string configPath(std::string_view);
|
||||
static std::string configPath(const model::BinaryPath&);
|
||||
static std::string contentOfPath(const std::string&);
|
||||
|
||||
static nlohmann::json credentialConfigContent(const model::BinaryPath&);
|
||||
static nlohmann::json databaseConfigContent(const model::BinaryPath&);
|
||||
static nlohmann::json pathConfigContent(const model::BinaryPath&);
|
||||
|
||||
void deleteCoverArtFile(const std::string&, const std::string&);
|
||||
static void deleteDirectories(model::Song, const std::string&);
|
||||
|
||||
private:
|
||||
void deleteSong(const model::Song);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef GENREMANAGER_H_
|
||||
#define GENREMANAGER_H_
|
||||
|
||||
#include "model/Models.h"
|
||||
|
||||
namespace manager
|
||||
{
|
||||
class GenreManager
|
||||
{
|
||||
public:
|
||||
GenreManager(const model::BinaryPath&);
|
||||
|
||||
model::Genre retrieveGenre(model::Genre&);
|
||||
model::Genre saveGenre(const model::Song&);
|
||||
|
||||
static void printGenre(const model::Genre&);
|
||||
private:
|
||||
model::BinaryPath m_bConf;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef SONGMANAGER_H_
|
||||
#define SONGMANAGER_H_
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "model/Models.h"
|
||||
|
||||
namespace manager
|
||||
{
|
||||
class SongManager
|
||||
{
|
||||
public:
|
||||
SongManager(std::string&);
|
||||
SongManager(const model::BinaryPath&);
|
||||
|
||||
void saveSong(model::Song&);
|
||||
void deleteSong(model::Song&);
|
||||
|
||||
static void printSong(const model::Song&);
|
||||
private:
|
||||
void saveSongTemp(model::Song&);
|
||||
void saveMisc(model::Song&);
|
||||
|
||||
model::BinaryPath m_bConf;
|
||||
std::string exe_path;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef TOKEN_MANAGER_H_
|
||||
#define TOKEN_MANAGER_H_
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <jwt-cpp/jwt.h>
|
||||
|
||||
#include "model/Models.h"
|
||||
#include "type/Scopes.h"
|
||||
|
||||
namespace manager
|
||||
{
|
||||
class TokenManager
|
||||
{
|
||||
public:
|
||||
TokenManager();
|
||||
|
||||
model::LoginResult retrieveToken();
|
||||
model::LoginResult retrieveToken(std::string_view);
|
||||
model::LoginResult retrieveToken(const model::BinaryPath&);
|
||||
|
||||
bool isTokenValid(std::string&, type::Scope);
|
||||
private:
|
||||
model::AuthCredentials parseAuthCredentials(std::string_view);
|
||||
model::AuthCredentials parseAuthCredentials(const model::BinaryPath&);
|
||||
|
||||
std::vector<std::string> extractScopes(const jwt::decoded_jwt&&);
|
||||
std::pair<bool, std::vector<std::string>> fetchAuthHeader(const std::string&);
|
||||
|
||||
bool tokenSupportsScope(const std::vector<std::string>, const std::string&&);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,22 @@
|
||||
#ifndef YEARMANAGER_H_
|
||||
#define YEARMANAGER_H_
|
||||
|
||||
#include "model/Models.h"
|
||||
|
||||
namespace manager
|
||||
{
|
||||
class YearManager
|
||||
{
|
||||
public:
|
||||
YearManager(const model::BinaryPath&);
|
||||
|
||||
model::Year retrieveYear(model::Year&);
|
||||
model::Year saveYear(const model::Song&);
|
||||
|
||||
static void printYear(const model::Year&);
|
||||
private:
|
||||
model::BinaryPath m_bConf;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user