Made progress
This commit is contained in:
@@ -5,8 +5,9 @@
|
||||
|
||||
namespace Models
|
||||
{
|
||||
struct Flags
|
||||
class Flags
|
||||
{
|
||||
public:
|
||||
std::string flag;
|
||||
std::string value;
|
||||
};
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user