diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2011-08-30 09:53:43 -0400 |
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2011-08-30 09:53:43 -0400 |
| commit | 6e8ba7e1179c0ac8c3a085e010992ea91fb15114 (patch) | |
| tree | f3301a6b4bd40850da6584df925615f7e3bc9db4 /indra/llui/llview.cpp | |
| parent | 5fb224bb8196e77259bef2a0ef60e82533c358a2 (diff) | |
CHOP-763: Introduce LLView::getPathname().
Diffstat (limited to 'indra/llui/llview.cpp')
| -rw-r--r-- | indra/llui/llview.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 56b09791a4..474b568a87 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -31,6 +31,7 @@ #include "llview.h" #include <cassert> +#include <sstream> #include <boost/tokenizer.hpp> #include <boost/foreach.hpp> #include <boost/bind.hpp> @@ -430,6 +431,24 @@ BOOL LLView::isInEnabledChain() const return enabled; } +static void buildPathname(std::ostream& out, const LLView* view) +{ + if (view) + { + // While we're not yet at root level, keep recurring towards top + buildPathname(out, view->getParent()); + } + // Build pathname into ostream on the way back from recursion. + out << '/' << view->getName(); +} + +std::string LLView::getPathname() const +{ + std::ostringstream out; + buildPathname(out, this); + return out.str(); +} + // virtual BOOL LLView::canFocusChildren() const { |
