aboutsummaryrefslogtreecommitdiff
path: root/src/tafgroup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tafgroup.cpp')
-rw-r--r--src/tafgroup.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/tafgroup.cpp b/src/tafgroup.cpp
index 1837bd8..9440912 100644
--- a/src/tafgroup.cpp
+++ b/src/tafgroup.cpp
@@ -162,3 +162,40 @@ const Bu::FString &Bu::TafGroup::getProperty( const Bu::FString &sName,
162 } 162 }
163} 163}
164 164
165const Bu::TafGroup *Bu::TafGroup::getChildByPath(
166 const Bu::FString &sPath ) const
167{
168 return getChildByPath( sPath.split('/') );
169}
170
171const Bu::TafGroup *Bu::TafGroup::getChildByPath( Bu::StrList lPath ) const
172{
173 const Bu::TafGroup *cur = this;
174
175 for( Bu::StrList::const_iterator i = lPath.begin(); i; i++ )
176 {
177 cur = cur->getChild( *i );
178 }
179
180 return cur;
181}
182
183const Bu::FString &Bu::TafGroup::getByPath( const Bu::FString &sPath ) const
184{
185 return getByPath( sPath.split('/') );
186}
187
188const Bu::FString &Bu::TafGroup::getByPath( Bu::StrList lPath ) const
189{
190 const Bu::TafGroup *cur = this;
191
192 for( Bu::StrList::const_iterator i = lPath.begin(); i; i++ )
193 {
194 if( !(i+1) )
195 break;
196 cur = cur->getChild( *i );
197 }
198
199 return cur->getProperty( lPath.last() );
200}
201