Added CLI functionality for uploading a song #7. Next thing that is up adding CLI functionality for downloading songs via id

This commit is contained in:
amazing-username
2019-06-05 20:51:56 -04:00
parent 8230f7b5ff
commit 7a6916c3ff
14 changed files with 185 additions and 27 deletions
+45
View File
@@ -0,0 +1,45 @@
#include"APIParser.h"
using Models::API;
using Models::IcarusAction;
namespace Parsers
{
#pragma
APIParser::APIParser(IcarusAction icaAct)
{
this->icaAct = icaAct;
api = API{};
parseAPI();
}
#pragma endregion
#pragma
API APIParser::retrieveAPI() const
{
return api;
}
void APIParser::parseAPI()
{
auto flags = icaAct.flags;
for (auto flag : flags)
{
auto arg = flag.flag;
auto value = flag.value;
if (arg.compare("-h") == 0)
{
api.url = value;
}
}
// TODO: For now I will hard code
// the api version since I am only
// on version 1
api.version = "v1";
}
#pragma functions
}