tageditor/cli/attachmentinfo.h

53 lines
1022 B
C
Raw Normal View History

2017-01-15 21:43:46 +01:00
#ifndef CLI_ATTACHMENT_INFO
#define CLI_ATTACHMENT_INFO
2018-03-06 02:04:35 +01:00
#include <tagparser/diagnostics.h>
2017-01-15 21:43:46 +01:00
#include <c++utilities/conversion/types.h>
namespace Media {
class AbstractContainer;
class AbstractAttachment;
}
namespace Cli {
enum class AttachmentAction {
Add,
Update,
Remove
};
class AttachmentInfo
{
public:
AttachmentInfo();
void parseDenotation(const char *denotation);
2018-03-06 02:04:35 +01:00
void apply(Media::AbstractContainer *container, Media::Diagnostics &diag);
void apply(Media::AbstractAttachment *attachment, Media::Diagnostics &diag);
2017-01-15 21:43:46 +01:00
void reset();
2018-03-06 02:04:35 +01:00
bool next(Media::AbstractContainer *container, Media::Diagnostics &diag);
2017-01-15 21:43:46 +01:00
AttachmentAction action;
uint64 id;
bool hasId;
const char *path;
const char *name;
const char *mime;
const char *desc;
};
inline AttachmentInfo::AttachmentInfo() :
action(AttachmentAction::Add),
id(0),
hasId(false),
path(nullptr),
name(nullptr),
mime(nullptr),
desc(nullptr)
{}
}
#endif // CLI_ATTACHMENT_INFO