3
* Copyright (C) 2010 Andrea Del Signore
5
* This library is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU Lesser General Public License as published by
7
* the Free Software Foundation, either version 2.1 of the License, or
8
* (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public License
16
* along with this library. If not, see <http://www.gnu.org/licenses/>.
19
* Andrea Del Signore <sejerpz@tin.it>
27
public class QueryOptions
29
public bool all_symbols = false; // don't filter
30
public bool only_creation_methods = false;
31
public bool only_static_factories = false; // this covers static methods factories and struct initialization
32
public bool only_error_domains = false;
33
public bool exclude_creation_methods = true;
34
public bool exclude_code_node = true; // skip code node: symbols that starts with ! and rapresent a statement with scope like if or foreach
36
public SymbolAccessibility access = SymbolAccessibility.ANY;
38
public bool auto_member_binding_mode = true; // if true the query function will adapt the member binding value automatically
39
public MemberBinding binding = MemberBinding.ANY;
41
public CompareMode compare_mode = CompareMode.EXACT;
43
public static QueryOptions standard ()
45
return new QueryOptions ();
48
public static QueryOptions creation_methods ()
50
var opt = new QueryOptions ();
51
opt.only_creation_methods = true;
52
opt.exclude_creation_methods = false;
56
public static QueryOptions factory_methods ()
58
var opt = new QueryOptions ();
59
opt.only_static_factories = true;
63
public static QueryOptions error_domains ()
65
var opt = new QueryOptions ();
66
opt.only_error_domains = true;
70
public void dump_settings ()
72
Utils.trace ("Member Binding (autoadapt: %s)", auto_member_binding_mode ? "true" : "false");
73
Utils.trace (" Instance: %s", (binding & MemberBinding.INSTANCE) != 0 ? "true" : "false");
74
Utils.trace (" Static: %s", (binding & MemberBinding.STATIC) != 0 ? "true" : "false");
75
Utils.trace (" Class: %s", (binding & MemberBinding.CLASS) != 0 ? "true" : "false");
77
Utils.trace ("Scope");
78
Utils.trace (" Private: %s", (access & SymbolAccessibility.PRIVATE) != 0 ? "true" : "false");
79
Utils.trace (" Protected: %s", (access & SymbolAccessibility.PROTECTED) != 0 ? "true" : "false");
80
Utils.trace (" Internal: %s", (access & SymbolAccessibility.INTERNAL) != 0 ? "true" : "false");
81
Utils.trace (" Public: %s", (access & SymbolAccessibility.PUBLIC) != 0 ? "true" : "false");
83
Utils.trace ("All symbols.............: %s", all_symbols ? "true" : "false");
84
Utils.trace ("Error domains only......: %s", only_error_domains ? "true" : "false");
85
Utils.trace ("Static factories only...: %s", only_static_factories ? "true" : "false");
86
Utils.trace ("Creation methods only...: %s", only_creation_methods ? "true" : "false");
87
Utils.trace ("Creation methods exclude: %s", exclude_creation_methods ? "true" : "false");