mirror of
https://github.com/fmang/opustags.git
synced 2025-07-06 17:47:51 +02:00
Add getters to TagsHandlers for most things
This commit is contained in:
@ -36,3 +36,9 @@ bool CompositeTagsHandler::done()
|
||||
done &= handler->done();
|
||||
return done;
|
||||
}
|
||||
|
||||
const std::vector<std::shared_ptr<ITagsHandler>>
|
||||
CompositeTagsHandler::get_handlers() const
|
||||
{
|
||||
return handlers;
|
||||
}
|
||||
|
@ -16,6 +16,8 @@ namespace opustags {
|
||||
bool edit(const int streamno, Tags &) override;
|
||||
bool done() override;
|
||||
|
||||
const std::vector<std::shared_ptr<ITagsHandler>> get_handlers() const;
|
||||
|
||||
private:
|
||||
std::vector<std::shared_ptr<ITagsHandler>> handlers;
|
||||
};
|
||||
|
@ -11,6 +11,16 @@ InsertionTagsHandler::InsertionTagsHandler(
|
||||
{
|
||||
}
|
||||
|
||||
std::string InsertionTagsHandler::get_tag_key() const
|
||||
{
|
||||
return tag_key;
|
||||
}
|
||||
|
||||
std::string InsertionTagsHandler::get_tag_value() const
|
||||
{
|
||||
return tag_value;
|
||||
}
|
||||
|
||||
bool InsertionTagsHandler::edit_impl(Tags &tags)
|
||||
{
|
||||
if (tags.contains(tag_key))
|
||||
|
@ -12,6 +12,9 @@ namespace opustags {
|
||||
const std::string &tag_key,
|
||||
const std::string &tag_value);
|
||||
|
||||
std::string get_tag_key() const;
|
||||
std::string get_tag_value() const;
|
||||
|
||||
protected:
|
||||
bool edit_impl(Tags &) override;
|
||||
|
||||
|
@ -10,6 +10,16 @@ ModificationTagsHandler::ModificationTagsHandler(
|
||||
{
|
||||
}
|
||||
|
||||
std::string ModificationTagsHandler::get_tag_key() const
|
||||
{
|
||||
return tag_key;
|
||||
}
|
||||
|
||||
std::string ModificationTagsHandler::get_tag_value() const
|
||||
{
|
||||
return tag_value;
|
||||
}
|
||||
|
||||
bool ModificationTagsHandler::edit_impl(Tags &tags)
|
||||
{
|
||||
tags.set(tag_key, tag_value);
|
||||
|
@ -12,6 +12,9 @@ namespace opustags {
|
||||
const std::string &tag_key,
|
||||
const std::string &tag_value);
|
||||
|
||||
std::string get_tag_key() const;
|
||||
std::string get_tag_value() const;
|
||||
|
||||
protected:
|
||||
bool edit_impl(Tags &) override;
|
||||
|
||||
|
@ -14,6 +14,11 @@ RemovalTagsHandler::RemovalTagsHandler(
|
||||
{
|
||||
}
|
||||
|
||||
std::string RemovalTagsHandler::get_tag_key() const
|
||||
{
|
||||
return tag_key;
|
||||
}
|
||||
|
||||
bool RemovalTagsHandler::edit_impl(Tags &tags)
|
||||
{
|
||||
if (tag_key.empty())
|
||||
|
@ -10,6 +10,8 @@ namespace opustags {
|
||||
RemovalTagsHandler(const int streamno);
|
||||
RemovalTagsHandler(const int streamno, const std::string &tag_key);
|
||||
|
||||
std::string get_tag_key() const;
|
||||
|
||||
protected:
|
||||
bool edit_impl(Tags &) override;
|
||||
|
||||
|
@ -2,11 +2,18 @@
|
||||
|
||||
using namespace opustags;
|
||||
|
||||
const int StreamTagsHandler::ALL_STREAMS = -1;
|
||||
|
||||
StreamTagsHandler::StreamTagsHandler(const int streamno)
|
||||
: streamno(streamno), work_finished(false)
|
||||
{
|
||||
}
|
||||
|
||||
int StreamTagsHandler::get_streamno() const
|
||||
{
|
||||
return streamno;
|
||||
}
|
||||
|
||||
bool StreamTagsHandler::relevant(const int streamno)
|
||||
{
|
||||
return streamno == this->streamno;
|
||||
|
@ -11,6 +11,8 @@ namespace opustags {
|
||||
public:
|
||||
StreamTagsHandler(const int streamno);
|
||||
|
||||
int get_streamno() const;
|
||||
|
||||
bool relevant(const int streamno) override;
|
||||
void list(const int streamno, const Tags &) override;
|
||||
bool edit(const int streamno, Tags &) override;
|
||||
|
Reference in New Issue
Block a user