aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/filter.cpp
blob: 3f2ac70b00b3c8510581bd2a2995c05c3e50c2d0 (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
39
40
41
42
43
44
45
46
47
48
// 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 <string>
#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);
}

Union::Union(const Union& filter)
{
    m_filters = filter.filters();
}

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

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

Intersection::Intersection(const Intersection& filter)
{
    m_filters = filter.filters();
}

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

    return filter;
}