aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/objecttypeoperators.h
blob: 6144952ca28eb24fd5f188698f60444d7ad90cc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#ifndef OBJECTTYPEOPERATORS_H
#define OBJECTTYPEOPERATORS_H

#include "libsamplemacros.h"

#include <string>

class LIBSAMPLE_API ObjectTypeOperators
{
public:
    LIBMINIMAL_DISABLE_COPY_MOVE(ObjectTypeOperators)

    explicit ObjectTypeOperators(const std::string key);
    virtual ~ObjectTypeOperators() = default;

    bool operator==(const ObjectTypeOperators &other) const;
    const ObjectTypeOperators &operator<(const ObjectTypeOperators &other) const;

    // chaos!
    virtual void operator>(const ObjectTypeOperators &) { m_key.append("operator>"); }

    std::string key() const { return m_key; }

private:
    std::string m_key;
};

LIBSAMPLE_API bool operator==(const ObjectTypeOperators *obj, const std::string &str);
LIBSAMPLE_API bool operator==(const std::string &str, const ObjectTypeOperators *obj);
LIBSAMPLE_API std::string operator+(const ObjectTypeOperators *obj, const std::string &str);
LIBSAMPLE_API std::string operator+(const std::string &str, const ObjectTypeOperators *obj);

#endif // OBJECTTYPEOPERATORS_H