aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/filter.cpp
blob: 9508479854eb6c8260791ed827a2571902c5203d (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
37
38
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "filter.h"

Data::Data(Field field, std::string value)
    : m_field(field), m_value(value)
{
}

Union::Union(const Data &filter)
{
    m_filters.push_back(filter);
}

Union::Union(const Intersection &filter)
{
    m_filters.push_back(filter);
}

Intersection::Intersection(const Data &filter)
{
    m_filters.push_back(filter);
}

Intersection::Intersection(const Union &filter)
{
    m_filters.push_back(filter);
}

Intersection operator&(const Intersection &a, const Intersection &b)
{
    Intersection filter;
    filter.addFilter(a);
    filter.addFilter(b);

    return filter;
}