Fission FSN
Loading...
Searching...
No Matches
fsCGuiParseTree.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: fsCGuiParseTree.h
4*
5* Purpose: Neutral, engine-free representation of a parsed GUI
6* layout file, produced by fsIGuiComponent::parseToTree()
7* and consumed by fsIGuiComponent::constructFromTree().
8* Same shape as the Rust port's GuiComponentRef so the
9* two can be diffed against one another.
10*
11*********************************************************************/
12
13#ifndef fsCGuiParseTreehdr
14#define fsCGuiParseTreehdr
15
16#include <map>
17#include <memory>
18#include <vector>
19
20#include <fsCore/fsStr.h>
21
23{
26 std::map<fsStr, fsStr> mParams;
27 std::vector<std::unique_ptr<fsCGuiParseNode>> mChildren;
28
29 fsCGuiParseNode(const fsStr& pComponentTypeName, fsCGuiParseNode* pParent) :
30 mComponentTypeName(pComponentTypeName),
31 mParent(pParent)
32 {
33 }
34};
35
36// A layout file's commands can contain more than one top-level element
37// (only the last one is treated as "the" gui by callers) so the tree
38// keeps every root in file order rather than assuming exactly one.
40{
41 std::vector<std::unique_ptr<fsCGuiParseNode>> mRoots;
42};
43
44#endif
Definition fsStr.h:23
std::vector< std::unique_ptr< fsCGuiParseNode > > mChildren
Definition fsCGuiParseTree.h:27
std::map< fsStr, fsStr > mParams
Definition fsCGuiParseTree.h:26
fsStr mComponentTypeName
Definition fsCGuiParseTree.h:24
fsCGuiParseNode * mParent
Definition fsCGuiParseTree.h:25
fsCGuiParseNode(const fsStr &pComponentTypeName, fsCGuiParseNode *pParent)
Definition fsCGuiParseTree.h:29
Definition fsCGuiParseTree.h:40
std::vector< std::unique_ptr< fsCGuiParseNode > > mRoots
Definition fsCGuiParseTree.h:41