gtk_ui_builder/ast/tree.rs
1use super::entry::Entry;
2use super::entries::prelude::*;
3
4#[derive(Default, Debug, Clone)]
5pub struct Tree {
6 pub root: Root
7}
8
9impl Tree {
10 pub fn new() -> Self {
11 Self::default()
12 }
13
14 pub fn add_child(&mut self, child: Entry) {
15 self.root.add_child(child);
16 }
17
18 pub fn require(&mut self, requirement: Requirement) {
19 self.root.require(requirement);
20 }
21
22 /// Get XML description of the tree
23 pub fn get_xml(&self) -> String {
24 self.root.get_xml()
25 }
26}