From 469bbcf0701e1eb8a6670c23145b0da87357e178 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 25 Mar 2012 20:00:08 +0000 Subject: Code is all reorganized. We're about ready to release. I should write up a little explenation of the arrangement. --- src/stable/tafgroup.h | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/stable/tafgroup.h (limited to 'src/stable/tafgroup.h') 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 @@ +/* + * Copyright (C) 2007-2011 Xagasoft, All rights reserved. + * + * This file is part of the libbu++ library and is released under the + * terms of the license contained in the file LICENSE. + */ + +#ifndef BU_TAF_GROUP_H +#define BU_TAF_GROUP_H + +#include +#include "bu/tafnode.h" +#include "bu/string.h" +#include "bu/hash.h" +#include "bu/list.h" + +namespace Bu +{ + typedef Bu::List StrList; + class TafProperty; + class TafComment; + /** + * + *@ingroup Taf + */ + class TafGroup : public TafNode + { + public: + typedef Bu::List PropList; + typedef Bu::Hash PropHash; + typedef Bu::List GroupList; + typedef Bu::Hash GroupHash; + typedef Bu::List NodeList; + + TafGroup( const TafGroup &rSrc ); + TafGroup( const Bu::String &sName ); + virtual ~TafGroup(); + + const Bu::String &getName() const; + void setName( const Bu::String &sName ); + + bool hasProperty( const Bu::String &sName ) const; + const Bu::String &getProperty( const Bu::String &sName ) const; + const Bu::String &getProperty( const Bu::String &sName, + const Bu::String &sDef ) const; + const PropList &getProperties( const Bu::String &sName ) const; + bool hasChild( const Bu::String &sName ) const; + const TafGroup *getChild( const Bu::String &sName ) const; + const GroupList &getChildren( const Bu::String &sName ) const; + TafNode *addChild( TafNode *pNode ); + TafGroup *addChild( TafGroup *pNode ); + TafProperty *addChild( TafProperty *pNode ); + TafComment *addChild( TafComment *pNode ); + TafGroup *addGroup( const Bu::String &sName ); + TafProperty *addProperty( + const Bu::String &sName, const Bu::String &sValue ); + const NodeList &getChildren() const; + const TafGroup *getChildByPath( const Bu::String &sPath ) const; + const TafGroup *getChildByPath( StrList lPath ) const; + const Bu::String &getByPath( const Bu::String &sPath ) const; + const Bu::String &getByPath( StrList lPath ) const; + + private: + Bu::String sName; + PropHash hProp; + GroupHash hChildren; + NodeList lChildren; + }; +} + +#endif -- cgit v1.2.3