diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-10-16 12:59:45 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-10-16 12:59:45 +0000 |
commit | 96b07a22f5392f5d7f821f5743deb3d64bd94e89 (patch) | |
tree | f8610916735e2bc5304031168f724cde7d909653 /src/tafnode.h | |
parent | 835c3420326a3a3a94baa8690bf09941182d29b0 (diff) | |
download | libbu++-96b07a22f5392f5d7f821f5743deb3d64bd94e89.tar.gz libbu++-96b07a22f5392f5d7f821f5743deb3d64bd94e89.tar.bz2 libbu++-96b07a22f5392f5d7f821f5743deb3d64bd94e89.tar.xz libbu++-96b07a22f5392f5d7f821f5743deb3d64bd94e89.zip |
Although this looks like a load of code changes, this represents no functional
change to the Taf system. Really all that's happened is I've broken out the
core taf data types into seperate files, and gone ahead and created a helpful
new header file ("taf.h") that will include the entire taf system, including
the reader and writer for you.
This means that a lot of programs will start complaining, but fortunately,
there's an easy solution, if it complains about taf, make sure to include taf.h
at the top, instead of other taf files and you'll be set.
The next set of changes will add lots of helpers to the taf system and change
the reader to read non-const structures, i.e. I'll actually add editing support
to created taf structures.
Diffstat (limited to 'src/tafnode.h')
-rw-r--r-- | src/tafnode.h | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/src/tafnode.h b/src/tafnode.h index f6d2ea9..5aa5082 100644 --- a/src/tafnode.h +++ b/src/tafnode.h | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <stdint.h> | 11 | #include <stdint.h> |
12 | #include "bu/fstring.h" | 12 | #include "bu/fstring.h" |
13 | #include "bu/hash.h" | 13 | #include "bu/hash.h" |
14 | #include "bu/list.h" | ||
15 | #include "bu/exceptionbase.h" | 14 | #include "bu/exceptionbase.h" |
16 | 15 | ||
17 | namespace Bu | 16 | namespace Bu |
@@ -40,87 +39,6 @@ namespace Bu | |||
40 | private: | 39 | private: |
41 | NodeType eType; | 40 | NodeType eType; |
42 | }; | 41 | }; |
43 | |||
44 | class TafProperty; | ||
45 | class TafComment; | ||
46 | /** | ||
47 | * | ||
48 | *@ingroup Taf | ||
49 | */ | ||
50 | class TafGroup : public TafNode | ||
51 | { | ||
52 | public: | ||
53 | typedef Bu::List<Bu::FString> PropList; | ||
54 | typedef Bu::Hash<Bu::FString, PropList> PropHash; | ||
55 | typedef Bu::List<class Bu::TafGroup *> GroupList; | ||
56 | typedef Bu::Hash<Bu::FString, GroupList> GroupHash; | ||
57 | typedef Bu::List<class Bu::TafNode *> NodeList; | ||
58 | |||
59 | TafGroup( const Bu::FString &sName ); | ||
60 | virtual ~TafGroup(); | ||
61 | |||
62 | const Bu::FString &getName() const; | ||
63 | void setName( const Bu::FString &sName ); | ||
64 | |||
65 | bool hasProperty( const Bu::FString &sName ) const; | ||
66 | const Bu::FString &getProperty( const Bu::FString &sName ) const; | ||
67 | const Bu::FString &getProperty( const Bu::FString &sName, | ||
68 | const Bu::FString &sDef ) const; | ||
69 | const PropList &getProperties( const Bu::FString &sName ) const; | ||
70 | bool hasChild( const Bu::FString &sName ) const; | ||
71 | const TafGroup *getChild( const Bu::FString &sName ) const; | ||
72 | const GroupList &getChildren( const Bu::FString &sName ) const; | ||
73 | TafNode *addChild( TafNode *pNode ); | ||
74 | TafGroup *addChild( TafGroup *pNode ); | ||
75 | TafProperty *addChild( TafProperty *pNode ); | ||
76 | TafComment *addChild( TafComment *pNode ); | ||
77 | TafGroup *addGroup( const Bu::FString &sName ); | ||
78 | TafProperty *addProperty( | ||
79 | const Bu::FString &sName, const Bu::FString &sValue ); | ||
80 | const NodeList &getChildren() const; | ||
81 | |||
82 | private: | ||
83 | Bu::FString sName; | ||
84 | PropHash hProp; | ||
85 | GroupHash hChildren; | ||
86 | NodeList lChildren; | ||
87 | }; | ||
88 | |||
89 | /** | ||
90 | * | ||
91 | *@ingroup Taf | ||
92 | */ | ||
93 | class TafProperty : public TafNode | ||
94 | { | ||
95 | public: | ||
96 | TafProperty( const Bu::FString &sName, const Bu::FString &sValue ); | ||
97 | virtual ~TafProperty(); | ||
98 | |||
99 | const Bu::FString &getName() const; | ||
100 | const Bu::FString &getValue() const; | ||
101 | |||
102 | private: | ||
103 | Bu::FString sName; | ||
104 | Bu::FString sValue; | ||
105 | }; | ||
106 | |||
107 | /** | ||
108 | * | ||
109 | *@ingroup Taf | ||
110 | */ | ||
111 | class TafComment : public TafNode | ||
112 | { | ||
113 | public: | ||
114 | TafComment( const Bu::FString &sText, bool bEOL=false ); | ||
115 | virtual ~TafComment(); | ||
116 | |||
117 | const Bu::FString &getText() const; | ||
118 | bool isEOLStyle() const; | ||
119 | |||
120 | private: | ||
121 | Bu::FString sText; | ||
122 | bool bEOL; | ||
123 | }; | ||
124 | } | 42 | } |
125 | 43 | ||
126 | #endif | 44 | #endif |