diff options
author | Mic Bowman | 2013-02-13 07:14:04 -0800 |
---|---|---|
committer | Mic Bowman | 2013-02-13 07:14:04 -0800 |
commit | bcb172301dfc1d8dcdb837be89c3ce3248500cc0 (patch) | |
tree | c6e86bda51d3922395d629f8c62f5d359b8ccbe4 /OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | |
parent | Make path parsing more robust in the JsonStore. (diff) | |
download | opensim-SC-bcb172301dfc1d8dcdb837be89c3ce3248500cc0.zip opensim-SC-bcb172301dfc1d8dcdb837be89c3ce3248500cc0.tar.gz opensim-SC-bcb172301dfc1d8dcdb837be89c3ce3248500cc0.tar.bz2 opensim-SC-bcb172301dfc1d8dcdb837be89c3ce3248500cc0.tar.xz |
Adds a couple requested functions to the JsonStore script
interface. JsonPathType returns the type of node pointed to by the
path and deprecates the functionality of both JsonTestPath
functions. JsonArrayLength returns the length of an array node.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index e436304..3955bff 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | |||
@@ -167,7 +167,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
167 | try | 167 | try |
168 | { | 168 | { |
169 | m_comms.RegisterScriptInvocations(this); | 169 | m_comms.RegisterScriptInvocations(this); |
170 | 170 | m_comms.RegisterConstants(this); | |
171 | |||
171 | // m_comms.RegisterScriptInvocation(this, "JsonCreateStore"); | 172 | // m_comms.RegisterScriptInvocation(this, "JsonCreateStore"); |
172 | // m_comms.RegisterScriptInvocation(this, "JsonAttachObjectStore"); | 173 | // m_comms.RegisterScriptInvocation(this, "JsonAttachObjectStore"); |
173 | // m_comms.RegisterScriptInvocation(this, "JsonDestroyStore"); | 174 | // m_comms.RegisterScriptInvocation(this, "JsonDestroyStore"); |
@@ -214,6 +215,22 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
214 | 215 | ||
215 | #endregion | 216 | #endregion |
216 | 217 | ||
218 | #region ScriptConstantInteface | ||
219 | |||
220 | [ScriptConstant] | ||
221 | public static readonly int JSONTYPEUNDEF = (int)JsonStoreNodeType.Undefined; | ||
222 | |||
223 | [ScriptConstant] | ||
224 | public static readonly int JSONTYPEOBJECT = (int)JsonStoreNodeType.Object; | ||
225 | |||
226 | [ScriptConstant] | ||
227 | public static readonly int JSONTYPEARRAY = (int)JsonStoreNodeType.Array; | ||
228 | |||
229 | [ScriptConstant] | ||
230 | public static readonly int JSONTYPEVALUE = (int)JsonStoreNodeType.Value; | ||
231 | |||
232 | #endregion | ||
233 | |||
217 | #region ScriptInvocationInteface | 234 | #region ScriptInvocationInteface |
218 | // ----------------------------------------------------------------- | 235 | // ----------------------------------------------------------------- |
219 | /// <summary> | 236 | /// <summary> |
@@ -319,6 +336,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
319 | /// </summary> | 336 | /// </summary> |
320 | // ----------------------------------------------------------------- | 337 | // ----------------------------------------------------------------- |
321 | [ScriptInvocation] | 338 | [ScriptInvocation] |
339 | public int JsonPathType(UUID hostID, UUID scriptID, UUID storeID, string path) | ||
340 | { | ||
341 | return (int)m_store.PathType(storeID,path); | ||
342 | } | ||
343 | |||
344 | [ScriptInvocation] | ||
322 | public int JsonTestPath(UUID hostID, UUID scriptID, UUID storeID, string path) | 345 | public int JsonTestPath(UUID hostID, UUID scriptID, UUID storeID, string path) |
323 | { | 346 | { |
324 | return m_store.TestPath(storeID,path,false) ? 1 : 0; | 347 | return m_store.TestPath(storeID,path,false) ? 1 : 0; |
@@ -364,6 +387,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
364 | /// </summary> | 387 | /// </summary> |
365 | // ----------------------------------------------------------------- | 388 | // ----------------------------------------------------------------- |
366 | [ScriptInvocation] | 389 | [ScriptInvocation] |
390 | public int JsonArrayLength(UUID hostID, UUID scriptID, UUID storeID, string path) | ||
391 | { | ||
392 | return m_store.ArrayLength(storeID,path); | ||
393 | } | ||
394 | |||
395 | // ----------------------------------------------------------------- | ||
396 | /// <summary> | ||
397 | /// | ||
398 | /// </summary> | ||
399 | // ----------------------------------------------------------------- | ||
400 | [ScriptInvocation] | ||
367 | public string JsonGetValue(UUID hostID, UUID scriptID, UUID storeID, string path) | 401 | public string JsonGetValue(UUID hostID, UUID scriptID, UUID storeID, string path) |
368 | { | 402 | { |
369 | string value = String.Empty; | 403 | string value = String.Empty; |