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:
Mic Bowman
2013-03-05 20:33:17 -08:00
parent 30e06b0742
commit 9875e840f7
5 changed files with 143 additions and 35 deletions

View File

@@ -270,7 +270,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
///
/// </summary>
// -----------------------------------------------------------------
public JsonStoreNodeType GetPathType(UUID storeID, string path)
public JsonStoreNodeType GetNodeType(UUID storeID, string path)
{
if (! m_enabled) return JsonStoreNodeType.Undefined;
@@ -287,7 +287,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
try
{
lock (map)
return map.PathType(path);
return map.GetNodeType(path);
}
catch (Exception e)
{
@@ -297,6 +297,38 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
return JsonStoreNodeType.Undefined;
}
// -----------------------------------------------------------------
/// <summary>
///
/// </summary>
// -----------------------------------------------------------------
public JsonStoreValueType GetValueType(UUID storeID, string path)
{
if (! m_enabled) return JsonStoreValueType.Undefined;
JsonStore map = null;
lock (m_JsonValueStore)
{
if (! m_JsonValueStore.TryGetValue(storeID,out map))
{
m_log.InfoFormat("[JsonStore] Missing store {0}",storeID);
return JsonStoreValueType.Undefined;
}
}
try
{
lock (map)
return map.GetValueType(path);
}
catch (Exception e)
{
m_log.Error(string.Format("[JsonStore]: Path test failed for {0} in {1}", path, storeID), e);
}
return JsonStoreValueType.Undefined;
}
// -----------------------------------------------------------------
/// <summary>
///