added flag to prevent the user from being prompted when uploading songs from a directory
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define ACTIONMANAGER_H_
|
||||
|
||||
#include<string>
|
||||
#include<string_view>
|
||||
#include<array>
|
||||
#include<vector>
|
||||
|
||||
@@ -17,25 +18,23 @@ namespace Managers
|
||||
|
||||
Models::IcarusAction retrieveIcarusAction() const;
|
||||
private:
|
||||
bool isNumber(std::string);
|
||||
constexpr std::array<const char*, 12> supportedFlags() noexcept;
|
||||
constexpr std::array<const char*, 4> supportedActions() noexcept;
|
||||
|
||||
bool isNumber(const std::string_view) noexcept;
|
||||
|
||||
void initialize();
|
||||
void validateFlags();
|
||||
|
||||
std::vector<std::string> parsedFlags();
|
||||
|
||||
void printAction();
|
||||
void printFlags();
|
||||
void printAction() noexcept;
|
||||
void printFlags() noexcept;
|
||||
|
||||
std::string action;
|
||||
std::array<std::string, 4> supportedActions{
|
||||
"download", "upload", "retrieve", "delete"
|
||||
};
|
||||
std::array<std::string, 11> supportedFlags{
|
||||
"-u", "-p", "-t", "-h", "-s", "-sd",
|
||||
"-sr", "-d", "-D", "-b", "-rt"
|
||||
};
|
||||
|
||||
std::vector<Models::Flags> flags;
|
||||
|
||||
char **params;
|
||||
int paramCount;
|
||||
};
|
||||
|
||||
@@ -17,12 +17,16 @@ namespace Managers
|
||||
|
||||
void commitAction();
|
||||
|
||||
enum RetrieveTypes
|
||||
enum class RetrieveTypes
|
||||
{
|
||||
songs
|
||||
};
|
||||
|
||||
private:
|
||||
enum class ActionValues;
|
||||
|
||||
std::map<std::string, ActionValues> mapActions() noexcept;
|
||||
|
||||
Models::Token parseToken(Models::API);
|
||||
|
||||
void deleteSong();
|
||||
@@ -30,7 +34,7 @@ namespace Managers
|
||||
void retrieveObjects();
|
||||
void uploadSong();
|
||||
|
||||
enum ActionValues
|
||||
enum class ActionValues
|
||||
{
|
||||
deleteAct,
|
||||
downloadAct,
|
||||
@@ -38,12 +42,6 @@ namespace Managers
|
||||
uploadAct
|
||||
};
|
||||
|
||||
std::map<std::string, ActionValues> mapActions{
|
||||
{"delete", deleteAct}, {"download", downloadAct},
|
||||
{"retrieve", retrieveAct},
|
||||
{"upload", uploadAct}
|
||||
};
|
||||
|
||||
Models::IcarusAction icaAction;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -25,7 +25,8 @@ namespace Syncers
|
||||
Upload(Models::API);
|
||||
|
||||
Models::Song uploadSong(const Models::Token&, Models::Song&);
|
||||
void uploadSongsFromDirectory(const Models::Token&, const std::string&, bool);
|
||||
void uploadSongsFromDirectory(const Models::Token&,
|
||||
const std::string&, const bool, bool);
|
||||
private:
|
||||
Managers::FileManager fMgr;
|
||||
Models::API api;
|
||||
@@ -40,7 +41,7 @@ namespace Syncers
|
||||
|
||||
void printSongDetails();
|
||||
void printSongDetails(std::vector<Models::Song>&);
|
||||
void printJsonData(nlohmann::json);
|
||||
void printJsonData(const nlohmann::json&);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user