1 /**
2 Copyright: Copyright (c) 2017, Joakim Brännström. All rights reserved.
3 License: MPL-2
4 Author: Joakim Brännström (joakim.brannstrom@gmx.com)
5 
6 This Source Code Form is subject to the terms of the Mozilla Public License,
7 v.2.0. If a copy of the MPL was not distributed with this file, You can obtain
8 one at http://mozilla.org/MPL/2.0/.
9 */
10 module dextool.plugin.ctestdouble.frontend.types;
11 
12 /// A symbol to filter. How it is used is handled by the query function.
13 struct FilterSymbol {
14 @safe:
15 
16     private bool[string] filter;
17     private bool has_symbols;
18 
19     bool contains(string symbol) {
20         if (symbol in filter)
21             return true;
22         return false;
23     }
24 
25     bool hasSymbols() {
26         return has_symbols;
27     }
28 
29     void put(string symbol) {
30         has_symbols = true;
31         filter[symbol] = true;
32     }
33 
34     auto range() @trusted {
35         return filter.byKeyValue();
36     }
37 }