1 /**
2 Date: 2015-2017, Joakim Brännström
3 License: MPL-2, Mozilla Public License 2.0
4 Author: Joakim Brännström (joakim.brannstrom@gmx.com)
5 */
6 module cpptooling.analyzer.clang.store;
7 
8 import std.typecons : Nullable;
9 
10 import clang.Cursor : Cursor;
11 
12 import cpptooling.analyzer.clang.type : TypeResults;
13 import cpptooling.data.symbol : Container;
14 
15 //TODO remove the default value for indent.
16 void put(ref Nullable!TypeResults tr, ref Container container, in uint indent = 0) @safe {
17     import std.range : chain, only;
18 
19     if (tr.isNull) {
20         return;
21     }
22 
23     foreach (a; chain(only(tr.primary), tr.extra)) {
24         container.put(a.type.kind);
25         container.put(a.location, a.type.kind.usr, a.type.attr.isDefinition);
26     }
27 }