diff options
Diffstat (limited to 'parameter/PathNavigator.cpp')
-rw-r--r-- | parameter/PathNavigator.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/parameter/PathNavigator.cpp b/parameter/PathNavigator.cpp index 1911002..cb6bec3 100644 --- a/parameter/PathNavigator.cpp +++ b/parameter/PathNavigator.cpp @@ -50,6 +50,35 @@ bool CPathNavigator::isPathValid() const return _bValid; } +// Navigate through +bool CPathNavigator::navigateThrough(const string& strItemName, string& strError) +{ + if (!_bValid) { + + strError = "Path not well formed"; + + return false; + } + + string* pStrChildName = next(); + + if (!pStrChildName) { + + strError = "Path not complete"; + + return false; + } + + if (*pStrChildName != strItemName) { + + strError = "Path not found"; + + return false; + } + + return true; +} + string* CPathNavigator::next() { if (_uiCurrentIndex < _astrItems.size()) { |