mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-22 01:57:31 -05:00
Add AnyOptionIsEnabled()
This commit is contained in:
parent
626606100f
commit
54b81d1a42
|
|
@ -172,6 +172,22 @@ bool TwitchToken::OptionIsEnabled(const TokenOption &option) const
|
|||
return false;
|
||||
}
|
||||
|
||||
bool TwitchToken::AnyOptionIsEnabled(
|
||||
const std::vector<TokenOption> &options) const
|
||||
{
|
||||
if (options.empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (const auto &tokenOption : options) {
|
||||
if (OptionIsEnabled(tokenOption)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void TwitchToken::SetToken(const std::string &value)
|
||||
{
|
||||
_token = value;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ public:
|
|||
void Load(obs_data_t *obj);
|
||||
void Save(obs_data_t *obj) const;
|
||||
std::string GetName() { return _name; }
|
||||
bool OptionIsEnabled(const TokenOption &) const;
|
||||
bool OptionIsEnabled(const TokenOption &option) const;
|
||||
bool AnyOptionIsEnabled(const std::vector<TokenOption> &options) const;
|
||||
void SetToken(const std::string &);
|
||||
bool IsEmpty() const { return _token.empty(); }
|
||||
std::optional<std::string> GetToken() const;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user