Debian Codegraph @

CodeLite/tag_tree.h

raw
1 //////////////////////////////////////////////////////////////////////////////
2 //////////////////////////////////////////////////////////////////////////////
3 //
4 // copyright : (C) 2008 by Eran Ifrah
5 // file name : tag_tree.h
6 //
7 // -------------------------------------------------------------------------
8 // A
9 // _____ _ _ _ _
10 // / __ \ | | | | (_) |
11 // | / \/ ___ __| | ___| | _| |_ ___
12 // | | / _ \ / _ |/ _ \ | | | __/ _ )
13 // | \__/\ (_) | (_| | __/ |___| | || __/
14 // \____/\___/ \__,_|\___\_____/_|\__\___|
15 //
16 // F i l e
17 //
18 // This program is free software; you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation; either version 2 of the License, or
21 // (at your option) any later version.
22 //
23 //////////////////////////////////////////////////////////////////////////////
24 //////////////////////////////////////////////////////////////////////////////
25 #ifndef CODELITE_TAG_TREE_H
26 #define CODELITE_TAG_TREE_H
27
28 #include <wx/string.h>
29 #include "smart_ptr.h"
30 #include "tree.h"
31 #include "codelite_exports.h"
32 #include "entry.h"
33
34 typedef TreeNode<wxString, TagEntry> TagNode;
35
36 /**
37 * Tree representation of tags.
38 * This is basically a data structure representing the GUI symbol tree.
39 *
40 * \date 08-23-2006
41 * \author eran
42 *
43 */
44 class WXDLLIMPEXP_CL TagTree : public Tree<wxString, TagEntry>
45 {
46 public:
47 /**
48 * Construct a tree with roots' values key & data.
49 * \param key Root's key
50 * \param data Root's data
51 */
52 TagTree(const wxString& key, const TagEntry& data);
53
54
55 /**
56 * Destructor
57 */
58 virtual ~TagTree();
59
60 /**
61 * Add an entry to the tree.
62 * This functions will add all parents of the tag to the tree if non exist (or some of some exist).
63 * For example: if TagName is box::m_string, this functions will make sure that a node 'box' exists.
64 * If not, it will add it and then will add m_string to it as its child.
65 * \param tag Tag to add
66 * \return new node that was added to the tree.
67 */
68 TagNode* AddEntry(TagEntry& tag);
69
70 };
71
72 typedef SmartPtr<TagTree> TagTreePtr;
73
74 #endif // CODELITE_TAG_TREE_H