aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs
diff options
context:
space:
mode:
authorMic Bowman2013-03-05 20:33:17 -0800
committerMic Bowman2013-03-05 20:33:17 -0800
commit9875e840f7e71f0b253c0b2aa90d47edc9c77b64 (patch)
treec2d71dc50c1f9eb48879d65038c6efd2ccca5686 /OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs
parentConvert doubles passed back through the MOD interface into LSL_Floats (diff)
downloadopensim-SC_OLD-9875e840f7e71f0b253c0b2aa90d47edc9c77b64.zip
opensim-SC_OLD-9875e840f7e71f0b253c0b2aa90d47edc9c77b64.tar.gz
opensim-SC_OLD-9875e840f7e71f0b253c0b2aa90d47edc9c77b64.tar.bz2
opensim-SC_OLD-9875e840f7e71f0b253c0b2aa90d47edc9c77b64.tar.xz
Per discussions with justincc... split the JsonStore type
functions into one for node type and one for value type. Define and export constants for both nodes and values.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs39
1 files changed, 38 insertions, 1 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs
index 40adba1..e498c6a 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs
@@ -145,7 +145,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
145 /// 145 ///
146 /// </summary> 146 /// </summary>
147 // ----------------------------------------------------------------- 147 // -----------------------------------------------------------------
148 public JsonStoreNodeType PathType(string expr) 148 public JsonStoreNodeType GetNodeType(string expr)
149 { 149 {
150 Stack<string> path; 150 Stack<string> path;
151 if (! ParsePathExpression(expr,out path)) 151 if (! ParsePathExpression(expr,out path))
@@ -173,6 +173,43 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
173 /// 173 ///
174 /// </summary> 174 /// </summary>
175 // ----------------------------------------------------------------- 175 // -----------------------------------------------------------------
176 public JsonStoreValueType GetValueType(string expr)
177 {
178 Stack<string> path;
179 if (! ParsePathExpression(expr,out path))
180 return JsonStoreValueType.Undefined;
181
182 OSD result = ProcessPathExpression(ValueStore,path);
183
184 if (result == null)
185 return JsonStoreValueType.Undefined;
186
187 if (result is OSDMap)
188 return JsonStoreValueType.Undefined;
189
190 if (result is OSDArray)
191 return JsonStoreValueType.Undefined;
192
193 if (result is OSDBoolean)
194 return JsonStoreValueType.Boolean;
195
196 if (result is OSDInteger)
197 return JsonStoreValueType.Integer;
198
199 if (result is OSDReal)
200 return JsonStoreValueType.Float;
201
202 if (result is OSDString)
203 return JsonStoreValueType.String;
204
205 return JsonStoreValueType.Undefined;
206 }
207
208 // -----------------------------------------------------------------
209 /// <summary>
210 ///
211 /// </summary>
212 // -----------------------------------------------------------------
176 public int ArrayLength(string expr) 213 public int ArrayLength(string expr)
177 { 214 {
178 Stack<string> path; 215 Stack<string> path;