summaryrefslogtreecommitdiff
path: root/indra/llplugin/llpluginmessage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llplugin/llpluginmessage.cpp')
-rw-r--r--indra/llplugin/llpluginmessage.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/llplugin/llpluginmessage.cpp b/indra/llplugin/llpluginmessage.cpp
index bfabc5b7ca..e7412a1d8f 100644
--- a/indra/llplugin/llpluginmessage.cpp
+++ b/indra/llplugin/llpluginmessage.cpp
@@ -33,6 +33,7 @@
#include "llpluginmessage.h"
#include "llsdserialize.h"
+#include "u64.h"
LLPluginMessage::LLPluginMessage()
{
@@ -93,6 +94,14 @@ void LLPluginMessage::setValueReal(const std::string &key, F64 value)
mMessage["params"][key] = value;
}
+void LLPluginMessage::setValuePointer(const std::string &key, void* value)
+{
+ std::stringstream temp;
+ // iostreams should output pointer values in hex with an initial 0x by default.
+ temp << value;
+ setValue(key, temp.str());
+}
+
std::string LLPluginMessage::getClass(void) const
{
return mMessage["class"];
@@ -189,6 +198,20 @@ F64 LLPluginMessage::getValueReal(const std::string &key) const
return result;
}
+void* LLPluginMessage::getValuePointer(const std::string &key) const
+{
+ void* result = NULL;
+
+ if(mMessage["params"].has(key))
+ {
+ std::string value = mMessage["params"][key].asString();
+
+ result = (void*)llstrtou64(value.c_str(), NULL, 16);
+ }
+
+ return result;
+}
+
std::string LLPluginMessage::generate(void) const
{
std::ostringstream result;