Made progress

This commit is contained in:
kdeng00
2021-12-31 19:09:31 -05:00
parent 9930aab985
commit 14d3c9acc6
10 changed files with 296 additions and 59 deletions
+2 -1
View File
@@ -5,8 +5,9 @@
namespace Models
{
struct Flags
class Flags
{
public:
std::string flag;
std::string value;
};
+34 -1
View File
@@ -2,14 +2,47 @@
#define ICARUSACTION_H_
#include<string>
#include<algorithm>
#include<string_view>
#include<vector>
#include<iostream>
#include"Flags.h"
namespace Models
{
struct IcarusAction
class IcarusAction
{
public:
std::string retrieveFlagValue(const std::string_view flag)
{
std::string value;
const auto fg = std::find_if(flags.begin(), flags.end(), [&](Flags f)
{
return f.flag.compare(flag) == 0 ? true : false;
});
if (fg != flags.end())
{
value.assign(fg->value);
}
return value;
}
void print_action_and_flags() noexcept
{
std::cout<<"Action: "<<this->action<<"\n";
std::cout<<"Flag count: "<<this->flags.size()<<"\n";
for (const auto &flag : this->flags)
{
std::cout<<"flag "<<flag.flag<<" value "<<flag.value<<"\n";
}
std::cout<<"\n";
}
std::string action;
std::vector<Flags> flags;
};
+20 -1
View File
@@ -2,12 +2,22 @@
#define SONG_H_
#include<string>
#include<iostream>
namespace Models
{
struct Song
class Song
{
public:
Song() = default;
void printInfo()
{
std::cout<<"Title: "<<this->title<<"\n";
std::cout<<"\n";
}
int id;
std::string title;
std::string artist;
@@ -16,9 +26,18 @@ namespace Models
int year;
int duration;
int track;
int disc;
std::string data;
std::string songPath;
};
class CoverArt
{
public:
int id;
std::string title;
std::string path;
};
}
#endif