diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2023-05-04 16:09:11 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2023-05-04 16:09:11 +0300 |
commit | 109141a9bb57170f99b6a55f3bb6a8867e3b6b40 (patch) | |
tree | 041df08ac6b064e47a37dc3f531257754666158b /indra/llcommon/llsdutil.h | |
parent | 7ebf98713cb9f5ebbb41992b36e0b43c5e1682d3 (diff) | |
parent | e7c5b9fb0f75b1e75acf7c99eded5f7b697cdc60 (diff) |
Merge remote-tracking branch 'origin/zap-LLSDArray' into DRTVWR-580-maint-T
Diffstat (limited to 'indra/llcommon/llsdutil.h')
-rw-r--r-- | indra/llcommon/llsdutil.h | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h index 1321615805..372278c51a 100644 --- a/indra/llcommon/llsdutil.h +++ b/indra/llcommon/llsdutil.h @@ -191,75 +191,6 @@ LLSD& drill_ref( LLSD& blob, const LLSD& path); } -/***************************************************************************** -* LLSDArray -*****************************************************************************/ -/** - * Construct an LLSD::Array inline, with implicit conversion to LLSD. Usage: - * - * @code - * void somefunc(const LLSD&); - * ... - * somefunc(LLSDArray("text")(17)(3.14)); - * @endcode - * - * For completeness, LLSDArray() with no args constructs an empty array, so - * <tt>LLSDArray()("text")(17)(3.14)</tt> produces an array equivalent to the - * above. But for most purposes, LLSD() is already equivalent to an empty - * array, and if you explicitly want an empty isArray(), there's - * LLSD::emptyArray(). However, supporting a no-args LLSDArray() constructor - * follows the principle of least astonishment. - */ -class LLSDArray -{ -public: - LLSDArray(): - _data(LLSD::emptyArray()) - {} - - /** - * Need an explicit copy constructor. Consider the following: - * - * @code - * LLSD array_of_arrays(LLSDArray(LLSDArray(17)(34)) - * (LLSDArray("x")("y"))); - * @endcode - * - * The coder intends to construct [[17, 34], ["x", "y"]]. - * - * With the compiler's implicit copy constructor, s/he gets instead - * [17, 34, ["x", "y"]]. - * - * The expression LLSDArray(17)(34) constructs an LLSDArray with those two - * values. The reader assumes it should be converted to LLSD, as we always - * want with LLSDArray, before passing it to the @em outer LLSDArray - * constructor! This copy constructor makes that happen. - */ - LLSDArray(const LLSDArray& inner): - _data(LLSD::emptyArray()) - { - _data.append(inner); - } - - LLSDArray(const LLSD& value): - _data(LLSD::emptyArray()) - { - _data.append(value); - } - - LLSDArray& operator()(const LLSD& value) - { - _data.append(value); - return *this; - } - - operator LLSD() const { return _data; } - LLSD get() const { return _data; } - -private: - LLSD _data; -}; - namespace llsd { |