diff options
| author | Erik Kundiman <erik@megapahit.org> | 2026-10-20 16:20:00 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2026-10-20 16:20:00 +0800 |
| commit | 61e65e2c95779d29496e5859a6edac82fc3b1ddb (patch) | |
| tree | e0d70b7af955610b2a414b914c50d15f7af21015 /indra/llcommon/llsd.cpp | |
| parent | bbe494697ab37919f10009af516c711a685ac98e (diff) | |
| parent | 923f645a923e7f061f7ff2790d8510aa4b5ced36 (diff) | |
Merge tag 'Second_Life_Release#923f645a-26.5' into 26.5
Diffstat (limited to 'indra/llcommon/llsd.cpp')
| -rw-r--r-- | indra/llcommon/llsd.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index ad2ce231fa..19ed6d9bd8 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -1043,6 +1043,31 @@ void LLSD::clear() { Impl::assignUndefined(impl); } LLSD::Type LLSD::type() const { return safe(impl).type(); } +bool LLSD::isEmpty() const +{ + switch (type()) + { + case TypeUndefined: + return true; // Always empty + case TypeBinary: + return !asBoolean(); // Empty when default + case TypeInteger: + return !asInteger(); // Empty when default + case TypeReal: + return !asReal(); // Empty when default + case TypeString: + case TypeURI: + return asString().empty(); // Empty natively + case TypeArray: + case TypeMap: + return !size(); // Empty natively + default:; + } + // All other value types (TypeDate) don't have default values so can't be empty + return false; +} + + // Scalar Constructors LLSD::LLSD(Boolean v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } LLSD::LLSD(Integer v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } |
