X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Firctag.h;fp=src%2Fcommon%2Firctag.h;h=499bbccdc230c12a4a8aa5f48d28cdce5dda1c60;hb=53e50ab66a5b3fa00282545ebc22ce3433ecf42b;hp=0000000000000000000000000000000000000000;hpb=01d67be28f1eb983a1bd0b97f13160ffb6b39307;p=quassel.git diff --git a/src/common/irctag.h b/src/common/irctag.h new file mode 100644 index 00000000..499bbccd --- /dev/null +++ b/src/common/irctag.h @@ -0,0 +1,50 @@ +/*************************************************************************** + * Copyright (C) 2005-2019 by the Quassel Project * + * devel@quassel-irc.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) version 3. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#pragma once + +#include "common-export.h" + +#include +#include + +#include +#include + +struct COMMON_EXPORT IrcTagKey +{ + QString vendor; + QString key; + bool clientTag; + + explicit IrcTagKey(QString vendor, QString key, bool clientTag = false) : + vendor(std::move(vendor)), key(std::move(key)), clientTag(clientTag) + {} + + explicit IrcTagKey(QString key = {}) : + vendor(QString{}), key(std::move(key)), clientTag(false) + {} + + friend COMMON_EXPORT uint qHash(const IrcTagKey& key); + friend COMMON_EXPORT bool operator==(const IrcTagKey& a, const IrcTagKey& b); + friend COMMON_EXPORT bool operator<(const IrcTagKey& a, const IrcTagKey& b); + friend COMMON_EXPORT QDebug operator<<(QDebug dbg, const IrcTagKey& i); + friend COMMON_EXPORT std::ostream& operator<<(std::ostream& o, const IrcTagKey& i); +};