Added Manager namespace

This commit is contained in:
kdeng00
2019-09-01 14:14:46 -04:00
parent d44a5bb1bc
commit d16b8dc3c9
12 changed files with 94 additions and 83 deletions
+10 -7
View File
@@ -5,14 +5,17 @@
#include "models/models.h"
class coverArtManager
namespace Manager
{
public:
coverArtManager(const std::string&);
class coverArtManager
{
public:
coverArtManager(const std::string&);
Model::Cover saveCover(const Model::Song&, std::string&, const std::string&);
private:
std::string path;
};
Model::Cover saveCover(const Model::Song&, std::string&, const std::string&);
private:
std::string path;
};
}
#endif
+16 -14
View File
@@ -8,23 +8,25 @@
#include "models/models.h"
class directory_manager
namespace Manager
{
public:
class directory_manager
{
public:
static std::string create_directory_process(Model::Song, const std::string&);
static std::string configPath(std::string_view);
static std::string contentOfPath(std::string_view);
static std::string create_directory_process(Model::Song, const std::string&);
static std::string configPath(std::string_view);
static std::string contentOfPath(std::string_view);
static nlohmann::json credentialConfigContent(const std::string&);
static nlohmann::json databaseConfigContent(const std::string&);
static nlohmann::json pathConfigContent(const std::string&);
static nlohmann::json credentialConfigContent(const std::string&);
static nlohmann::json databaseConfigContent(const std::string&);
static nlohmann::json pathConfigContent(const std::string&);
void delete_cover_art_file(const std::string&, const std::string&);
static void delete_directories(Model::Song, const std::string&);
void delete_cover_art_file(const std::string&, const std::string&);
static void delete_directories(Model::Song, const std::string&);
private:
void delete_song(const Model::Song);
};
private:
void delete_song(const Model::Song);
};
}
#endif
+13 -10
View File
@@ -8,19 +8,22 @@
#include "models/models.h"
class song_manager
namespace Manager
{
public:
song_manager(std::string&);
class song_manager
{
public:
song_manager(std::string&);
void saveSong(Model::Song&);
void deleteSong(Model::Song&);
void saveSong(Model::Song&);
void deleteSong(Model::Song&);
static void printSong(const Model::Song&);
private:
void saveSongTemp(Model::Song&);
static void printSong(const Model::Song&);
private:
void saveSongTemp(Model::Song&);
std::string exe_path;
};
std::string exe_path;
};
}
#endif
+15 -12
View File
@@ -11,22 +11,25 @@
#include "models/models.h"
#include "types/scopes.h"
class token_manager
namespace Manager
{
public:
token_manager();
class token_manager
{
public:
token_manager();
Model::loginResult retrieve_token();
Model::loginResult retrieve_token(std::string_view);
Model::loginResult retrieve_token();
Model::loginResult retrieve_token(std::string_view);
bool is_token_valid(std::string&, Scope);
private:
Model::auth_credentials parse_auth_credentials(std::string_view);
bool is_token_valid(std::string&, Scope);
private:
Model::auth_credentials parse_auth_credentials(std::string_view);
std::vector<std::string> extract_scopes(const jwt::decoded_jwt&&);
std::pair<bool, std::vector<std::string>> fetch_auth_header(const std::string&);
std::vector<std::string> extract_scopes(const jwt::decoded_jwt&&);
std::pair<bool, std::vector<std::string>> fetch_auth_header(const std::string&);
bool token_supports_scope(const std::vector<std::string>, const std::string&&);
};
bool token_supports_scope(const std::vector<std::string>, const std::string&&);
};
}
#endif