diff options
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 7215086..234021c 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1186,6 +1186,33 @@ namespace OpenSim.Framework | |||
1186 | return null; | 1186 | return null; |
1187 | } | 1187 | } |
1188 | 1188 | ||
1189 | public static OSDMap GetOSDMap(string data) | ||
1190 | { | ||
1191 | OSDMap args = null; | ||
1192 | try | ||
1193 | { | ||
1194 | OSD buffer; | ||
1195 | // We should pay attention to the content-type, but let's assume we know it's Json | ||
1196 | buffer = OSDParser.DeserializeJson(data); | ||
1197 | if (buffer.Type == OSDType.Map) | ||
1198 | { | ||
1199 | args = (OSDMap)buffer; | ||
1200 | return args; | ||
1201 | } | ||
1202 | else | ||
1203 | { | ||
1204 | // uh? | ||
1205 | m_log.Debug(("[UTILS]: Got OSD of unexpected type " + buffer.Type.ToString())); | ||
1206 | return null; | ||
1207 | } | ||
1208 | } | ||
1209 | catch (Exception ex) | ||
1210 | { | ||
1211 | m_log.Debug("[UTILS]: exception on GetOSDMap " + ex.Message); | ||
1212 | return null; | ||
1213 | } | ||
1214 | } | ||
1215 | |||
1189 | public static string[] Glob(string path) | 1216 | public static string[] Glob(string path) |
1190 | { | 1217 | { |
1191 | string vol=String.Empty; | 1218 | string vol=String.Empty; |