summaryrefslogtreecommitdiff
path: root/indra/llcommon/llsdutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llsdutil.cpp')
-rw-r--r--indra/llcommon/llsdutil.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp
index 7cd0ed4c08..a6ac2fb12b 100644
--- a/indra/llcommon/llsdutil.cpp
+++ b/indra/llcommon/llsdutil.cpp
@@ -203,3 +203,14 @@ U32 ll_ipaddr_from_sd(const LLSD& sd)
memcpy(&ret, &(v[0]), 4); /* Flawfinder: ignore */
return ret;
}
+
+// Converts an LLSD binary to an LLSD string
+LLSD ll_string_from_binary(const LLSD& sd)
+{
+ std::vector<U8> value = sd.asBinary();
+ char* c_str = new char[value.size() + 1];
+ memcpy(c_str, &value[0], value.size());
+ c_str[value.size()] = '\0';
+
+ return c_str;
+}