diff options
| author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-26 10:57:51 +0100 |
|---|---|---|
| committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-26 10:57:51 +0100 |
| commit | 438f0e372ee8a1d41d535314e4061f20f6c66c88 (patch) | |
| tree | f329e9c86829b06ded1742db7edf271aacb7d3c1 /indra/llui/llurlentry.cpp | |
| parent | 1a987e8d32a733cace7ffdb239729380cd53f87c (diff) | |
| parent | a0467365140c504eb0f5ad053ac22a2698a2abd7 (diff) | |
merge from viewer-trunk
Diffstat (limited to 'indra/llui/llurlentry.cpp')
| -rw-r--r-- | indra/llui/llurlentry.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 736de651da..3375c13c94 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -765,3 +765,35 @@ std::string LLUrlEntryNoLink::getLabel(const std::string &url, const LLUrlLabelC { return getUrl(url); } + +// +// LLUrlEntryIcon describes an icon with <icon>...</icon> tags +// +LLUrlEntryIcon::LLUrlEntryIcon() +{ + mPattern = boost::regex("<icon\\s*>\\s*([^<]*)?\\s*</icon\\s*>", + boost::regex::perl|boost::regex::icase); + mDisabledLink = true; +} + +std::string LLUrlEntryIcon::getUrl(const std::string &url) const +{ + return LLStringUtil::null; +} + +std::string LLUrlEntryIcon::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ + return LLStringUtil::null; +} + +std::string LLUrlEntryIcon::getIcon(const std::string &url) +{ + // Grep icon info between <icon>...</icon> tags + // matches[1] contains the icon name/path + boost::match_results<std::string::const_iterator> matches; + mIcon = (boost::regex_match(url, matches, mPattern) && matches[1].matched) + ? matches[1] + : LLStringUtil::null; + LLStringUtil::trim(mIcon); + return mIcon; +} |
