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:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user