aboutsummaryrefslogtreecommitdiff
path: root/src/stable/tafgroup.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stable/tafgroup.h')
-rw-r--r--src/stable/tafgroup.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/stable/tafgroup.h b/src/stable/tafgroup.h
new file mode 100644
index 0000000..119e827
--- /dev/null
+++ b/src/stable/tafgroup.h
@@ -0,0 +1,71 @@
1/*
2 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
3 *
4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE.
6 */
7
8#ifndef BU_TAF_GROUP_H
9#define BU_TAF_GROUP_H
10
11#include <stdint.h>
12#include "bu/tafnode.h"
13#include "bu/string.h"
14#include "bu/hash.h"
15#include "bu/list.h"
16
17namespace Bu
18{
19 typedef Bu::List<Bu::String> StrList;
20 class TafProperty;
21 class TafComment;
22 /**
23 *
24 *@ingroup Taf
25 */
26 class TafGroup : public TafNode
27 {
28 public:
29 typedef Bu::List<Bu::String> PropList;
30 typedef Bu::Hash<Bu::String, PropList> PropHash;
31 typedef Bu::List<class Bu::TafGroup *> GroupList;
32 typedef Bu::Hash<Bu::String, GroupList> GroupHash;
33 typedef Bu::List<class Bu::TafNode *> NodeList;
34
35 TafGroup( const TafGroup &rSrc );
36 TafGroup( const Bu::String &sName );
37 virtual ~TafGroup();
38
39 const Bu::String &getName() const;
40 void setName( const Bu::String &sName );
41
42 bool hasProperty( const Bu::String &sName ) const;
43 const Bu::String &getProperty( const Bu::String &sName ) const;
44 const Bu::String &getProperty( const Bu::String &sName,
45 const Bu::String &sDef ) const;
46 const PropList &getProperties( const Bu::String &sName ) const;
47 bool hasChild( const Bu::String &sName ) const;
48 const TafGroup *getChild( const Bu::String &sName ) const;
49 const GroupList &getChildren( const Bu::String &sName ) const;
50 TafNode *addChild( TafNode *pNode );
51 TafGroup *addChild( TafGroup *pNode );
52 TafProperty *addChild( TafProperty *pNode );
53 TafComment *addChild( TafComment *pNode );
54 TafGroup *addGroup( const Bu::String &sName );
55 TafProperty *addProperty(
56 const Bu::String &sName, const Bu::String &sValue );
57 const NodeList &getChildren() const;
58 const TafGroup *getChildByPath( const Bu::String &sPath ) const;
59 const TafGroup *getChildByPath( StrList lPath ) const;
60 const Bu::String &getByPath( const Bu::String &sPath ) const;
61 const Bu::String &getByPath( StrList lPath ) const;
62
63 private:
64 Bu::String sName;
65 PropHash hProp;
66 GroupHash hChildren;
67 NodeList lChildren;
68 };
69}
70
71#endif