diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llmessage/llsdmessagereader.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rwxr-xr-x | linden/indra/llmessage/llsdmessagereader.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/linden/indra/llmessage/llsdmessagereader.cpp b/linden/indra/llmessage/llsdmessagereader.cpp index 70cc455..1f0effa 100755 --- a/linden/indra/llmessage/llsdmessagereader.cpp +++ b/linden/indra/llmessage/llsdmessagereader.cpp | |||
@@ -37,7 +37,15 @@ | |||
37 | #include "llsdmessagebuilder.h" | 37 | #include "llsdmessagebuilder.h" |
38 | #include "llsdutil.h" | 38 | #include "llsdutil.h" |
39 | 39 | ||
40 | LLSDMessageReader::LLSDMessageReader() | 40 | #include "v3math.h" |
41 | #include "v4math.h" | ||
42 | #include "v3dmath.h" | ||
43 | #include "v2math.h" | ||
44 | #include "llquaternion.h" | ||
45 | #include "v4color.h" | ||
46 | |||
47 | LLSDMessageReader::LLSDMessageReader() : | ||
48 | mMessageName(NULL) | ||
41 | { | 49 | { |
42 | } | 50 | } |
43 | 51 | ||
@@ -63,14 +71,20 @@ LLSD getLLSD(const LLSD& input, const char* block, const char* var, S32 blocknum | |||
63 | } | 71 | } |
64 | if(! input[block].isArray()) | 72 | if(! input[block].isArray()) |
65 | { | 73 | { |
66 | llerrs << "block " << block << " not found" << llendl; | 74 | // NOTE: babbage: need to return default for missing blocks to allow |
75 | // backwards/forwards compatibility - handlers must cope with default | ||
76 | // values. | ||
77 | llwarns << "block " << block << " not found" << llendl; | ||
67 | return LLSD(); | 78 | return LLSD(); |
68 | } | 79 | } |
69 | 80 | ||
70 | LLSD result = input[block][blocknum][var]; | 81 | LLSD result = input[block][blocknum][var]; |
71 | if(result.isUndefined()) | 82 | if(result.isUndefined()) |
72 | { | 83 | { |
73 | llerrs << "var " << var << " not found" << llendl; | 84 | // NOTE: babbage: need to return default for missing vars to allow |
85 | // backwards/forwards compatibility - handlers must cope with default | ||
86 | // values. | ||
87 | llwarns << "var " << var << " not found" << llendl; | ||
74 | } | 88 | } |
75 | return result; | 89 | return result; |
76 | } | 90 | } |
@@ -235,6 +249,12 @@ void LLSDMessageReader::getString(const char *block, const char *var, | |||
235 | buffer[data_size] = '\0'; | 249 | buffer[data_size] = '\0'; |
236 | } | 250 | } |
237 | 251 | ||
252 | //virtual | ||
253 | void LLSDMessageReader::getString(const char *block, const char *var, | ||
254 | std::string& outstr, S32 blocknum) | ||
255 | { | ||
256 | outstr = getLLSD(mMessage, block, var, blocknum).asString(); | ||
257 | } | ||
238 | 258 | ||
239 | //virtual | 259 | //virtual |
240 | S32 LLSDMessageReader::getNumberOfBlocks(const char *blockname) | 260 | S32 LLSDMessageReader::getNumberOfBlocks(const char *blockname) |