diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2011-02-03 22:54:16 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2011-02-03 22:54:16 -0500 |
commit | d814e76cad49d6ebeb8f34b13d5d946d9f675b76 (patch) | |
tree | 201d4b61d73b5aa4992cca89390933ab0fee6a8b /indra/llxml/tests | |
parent | 3cdd1931c67ae3be26549d05889e19ba26d3db03 (diff) |
Introduce BOOST_FOREACH() helpers for LLSD in llsdutil.h.
You can't directly write:
BOOST_FOREACH(LLSD item, someLLSDarray) { ... }
because LLSD has two distinct iteration mechanisms, one for arrays and one for
maps, neither using the standard [const_]iterator typedefs or begin()/end()
methods. But with these helpers, you can write:
BOOST_FOREACH(LLSD item, llsd::inArray(someLLSDarray)) { ... }
or
BOOST_FOREACH(const llsd::MapEntry& pair, llsd::inMap(someLLSDmap)) { ... }
These are in namespace llsd instead of being (e.g.) llsd_inMap because with a
namespace at least your .cpp file can have a local 'using':
using namespace llsd;
BOOST_FOREACH(LLSD item, inArray(someLLSDarray)) { ... }
It's namespace llsd rather than LLSD because LLSD can't be both a namespace
and a class name.
Diffstat (limited to 'indra/llxml/tests')
0 files changed, 0 insertions, 0 deletions