mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
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.
This commit is contained in:
@@ -145,7 +145,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public JsonStoreNodeType PathType(string expr)
|
||||
public JsonStoreNodeType GetNodeType(string expr)
|
||||
{
|
||||
Stack<string> path;
|
||||
if (! ParsePathExpression(expr,out path))
|
||||
@@ -168,6 +168,43 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||
return JsonStoreNodeType.Undefined;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
// -----------------------------------------------------------------
|
||||
public JsonStoreValueType GetValueType(string expr)
|
||||
{
|
||||
Stack<string> path;
|
||||
if (! ParsePathExpression(expr,out path))
|
||||
return JsonStoreValueType.Undefined;
|
||||
|
||||
OSD result = ProcessPathExpression(ValueStore,path);
|
||||
|
||||
if (result == null)
|
||||
return JsonStoreValueType.Undefined;
|
||||
|
||||
if (result is OSDMap)
|
||||
return JsonStoreValueType.Undefined;
|
||||
|
||||
if (result is OSDArray)
|
||||
return JsonStoreValueType.Undefined;
|
||||
|
||||
if (result is OSDBoolean)
|
||||
return JsonStoreValueType.Boolean;
|
||||
|
||||
if (result is OSDInteger)
|
||||
return JsonStoreValueType.Integer;
|
||||
|
||||
if (result is OSDReal)
|
||||
return JsonStoreValueType.Float;
|
||||
|
||||
if (result is OSDString)
|
||||
return JsonStoreValueType.String;
|
||||
|
||||
return JsonStoreValueType.Undefined;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user