<commit_before>/*
 * jid.h
 * Copyright (C) 2003  <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#ifndef XMPP_JID_H
#define XMPP_JID_H

#include <QString>

#ifdef IRIS_XMPP_JID_DEPRECATED
#define IRIS_XMPP_JID_DECL_DEPRECATED Q_DECL_DEPRECATED
#else
#define IRIS_XMPP_JID_DECL_DEPRECATED
#endif

namespace XMPP 
{
	class Jid
	{
	public:
		Jid();
		~Jid();

		Jid(const QString &s);
		Jid(const QString &node, const QString& domain, const QString& resource = "");
		Jid(const char *s);
		Jid & operator=(const QString &s);
		Jid & operator=(const char *s);

		bool isNull() const { return null; }
		const QString & domain() const { return d; }
		const QString & node() const { return n; }
		const QString & resource() const { return r; }
		const QString & bare() const { return b; }
		const QString & full() const { return f; }

		Jid withNode(const QString &s) const;
		Jid withResource(const QString &s) const;

		bool isValid() const;
		bool isEmpty() const;
		bool compare(const Jid &a, bool compareRes=true) const;

#ifdef IRIS_XMPP_JID_DEPRECATED
		IRIS_XMPP_JID_DECL_DEPRECATED const QString & host() const { return d; }
		IRIS_XMPP_JID_DECL_DEPRECATED const QString & user() const { return n; }
		IRIS_XMPP_JID_DECL_DEPRECATED const QString & userHost() const { return b; }
#endif

	private:
#ifdef IRIS_XMPP_JID_DEPRECATED
	public:<commit_msg>add operator==, operator!=<commit_after>/*
 * jid.h
 * Copyright (C) 2003  <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#ifndef XMPP_JID_H
#define XMPP_JID_H

#include <QString>

#ifdef IRIS_XMPP_JID_DEPRECATED
#define IRIS_XMPP_JID_DECL_DEPRECATED Q_DECL_DEPRECATED
#else
#define IRIS_XMPP_JID_DECL_DEPRECATED
#endif

namespace XMPP 
{
	class Jid
	{
	public:
		Jid();
		~Jid();

		Jid(const QString &s);
		Jid(const QString &node, const QString& domain, const QString& resource = "");
		Jid(const char *s);
		Jid & operator=(const QString &s);
		Jid & operator=(const char *s);

		bool isNull() const { return null; }
		const QString & domain() const { return d; }
		const QString & node() const { return n; }
		const QString & resource() const { return r; }
		const QString & bare() const { return b; }
		const QString & full() const { return f; }

		Jid withNode(const QString &s) const;
		Jid withResource(const QString &s) const;

		bool isValid() const;
		bool isEmpty() const;
		bool compare(const Jid &a, bool compareRes=true) const;
		inline bool operator==(const Jid &other) const { return compare(other, true); }
		inline bool operator!=(const Jid &other) const { return !(*this == other); }


#ifdef IRIS_XMPP_JID_DEPRECATED
		IRIS_XMPP_JID_DECL_DEPRECATED const QString & host() const { return d; }
		IRIS_XMPP_JID_DECL_DEPRECATED const QString & user() const { return n; }
		IRIS_XMPP_JID_DECL_DEPRECATED const QString & userHost() const { return b; }
#endif

	private:
#ifdef IRIS_XMPP_JID_DEPRECATED
	public:
{'fraction_non_alphanumeric': 0.09042181309718014, 'fraction_numerical': 0.00932183640177115, 'mean_word_length': 4.266257668711656, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1956426', 'n_tokens_mistral': 1485, 'n_tokens_neox': 1401, 'n_words': 525}