aboutsummaryrefslogtreecommitdiff
path: root/src/tafnode.h
blob: a570d2d25c109fb9faf6cb54fedcefa1a9944966 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef BU_TAF_NODE_H
#define BU_TAF_NODE_H

#include <stdint.h>
#include "bu/fstring.h"
#include "bu/hash.h"
#include "bu/list.h"

namespace Bu
{
	/**
	 *
	 */
	class TafNode
	{
	public:
		typedef Bu::List<Bu::FString> PropList;
		typedef Bu::Hash<Bu::FString, PropList> PropHash;
		typedef Bu::List<TafNode *> NodeList;
		typedef Bu::Hash<Bu::FString, NodeList> NodeHash;

	public:
		TafNode();
		virtual ~TafNode();

		void setName( const Bu::FString &sName );
		const Bu::FString &getName();

		void setProperty( Bu::FString sName, Bu::FString sValue );
		const PropList &getProperty( const Bu::FString &sName );
		const NodeList &getNode( const Bu::FString &sName );
		void addChild( TafNode *pNode );

	private:
		Bu::FString sName;
		PropHash hProp;
		NodeHash hChildren;
	};
}

#endif