Implements a very useful OSSL function to test a string to see

if it is a UUID. The function is osIsUUID().

Thanks SignpostMarv!
This commit is contained in:
Mic Bowman
2012-07-20 10:25:50 -07:00
parent fe99948c58
commit 644fb6b013
3 changed files with 26 additions and 0 deletions

View File

@@ -3274,5 +3274,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
InitLSL();
((LSL_Api)m_LSL_Api).DetachFromAvatar();
}
/// <summary>
/// Checks if thing is a UUID.
/// </summary>
/// <param name="thing"></param>
/// <returns>1 if thing is a valid UUID, 0 otherwise</returns>
public LSL_Integer osIsUUID(string thing)
{
CheckThreatLevel(ThreatLevel.None, "osIsUUID");
m_host.AddScriptLPS(1);
UUID test;
return UUID.TryParse(thing, out test) ? 1 : 0;
}
}
}