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.
This commit is contained in:
Mic Bowman
2013-02-13 07:14:04 -08:00
parent 708c3f8b86
commit bcb172301d
4 changed files with 162 additions and 1 deletions

View File

@@ -167,7 +167,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
try
{
m_comms.RegisterScriptInvocations(this);
m_comms.RegisterConstants(this);
// m_comms.RegisterScriptInvocation(this, "JsonCreateStore");
// m_comms.RegisterScriptInvocation(this, "JsonAttachObjectStore");
// m_comms.RegisterScriptInvocation(this, "JsonDestroyStore");
@@ -214,6 +215,22 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
#endregion
#region ScriptConstantInteface
[ScriptConstant]
public static readonly int JSONTYPEUNDEF = (int)JsonStoreNodeType.Undefined;
[ScriptConstant]
public static readonly int JSONTYPEOBJECT = (int)JsonStoreNodeType.Object;
[ScriptConstant]
public static readonly int JSONTYPEARRAY = (int)JsonStoreNodeType.Array;
[ScriptConstant]
public static readonly int JSONTYPEVALUE = (int)JsonStoreNodeType.Value;
#endregion
#region ScriptInvocationInteface
// -----------------------------------------------------------------
/// <summary>
@@ -318,6 +335,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
///
/// </summary>
// -----------------------------------------------------------------
[ScriptInvocation]
public int JsonPathType(UUID hostID, UUID scriptID, UUID storeID, string path)
{
return (int)m_store.PathType(storeID,path);
}
[ScriptInvocation]
public int JsonTestPath(UUID hostID, UUID scriptID, UUID storeID, string path)
{
@@ -358,6 +381,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
return m_store.RemoveValue(storeID,path) ? 1 : 0;
}
// -----------------------------------------------------------------
/// <summary>
///
/// </summary>
// -----------------------------------------------------------------
[ScriptInvocation]
public int JsonArrayLength(UUID hostID, UUID scriptID, UUID storeID, string path)
{
return m_store.ArrayLength(storeID,path);
}
// -----------------------------------------------------------------
/// <summary>
///