diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs index 40adba1..e498c6a 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStore.cs | |||
@@ -145,7 +145,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
145 | /// | 145 | /// |
146 | /// </summary> | 146 | /// </summary> |
147 | // ----------------------------------------------------------------- | 147 | // ----------------------------------------------------------------- |
148 | public JsonStoreNodeType PathType(string expr) | 148 | public JsonStoreNodeType GetNodeType(string expr) |
149 | { | 149 | { |
150 | Stack<string> path; | 150 | Stack<string> path; |
151 | if (! ParsePathExpression(expr,out path)) | 151 | if (! ParsePathExpression(expr,out path)) |
@@ -173,6 +173,43 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore | |||
173 | /// | 173 | /// |
174 | /// </summary> | 174 | /// </summary> |
175 | // ----------------------------------------------------------------- | 175 | // ----------------------------------------------------------------- |
176 | public JsonStoreValueType GetValueType(string expr) | ||
177 | { | ||
178 | Stack<string> path; | ||
179 | if (! ParsePathExpression(expr,out path)) | ||
180 | return JsonStoreValueType.Undefined; | ||
181 | |||
182 | OSD result = ProcessPathExpression(ValueStore,path); | ||
183 | |||
184 | if (result == null) | ||
185 | return JsonStoreValueType.Undefined; | ||
186 | |||
187 | if (result is OSDMap) | ||
188 | return JsonStoreValueType.Undefined; | ||
189 | |||
190 | if (result is OSDArray) | ||
191 | return JsonStoreValueType.Undefined; | ||
192 | |||
193 | if (result is OSDBoolean) | ||
194 | return JsonStoreValueType.Boolean; | ||
195 | |||
196 | if (result is OSDInteger) | ||
197 | return JsonStoreValueType.Integer; | ||
198 | |||
199 | if (result is OSDReal) | ||
200 | return JsonStoreValueType.Float; | ||
201 | |||
202 | if (result is OSDString) | ||
203 | return JsonStoreValueType.String; | ||
204 | |||
205 | return JsonStoreValueType.Undefined; | ||
206 | } | ||
207 | |||
208 | // ----------------------------------------------------------------- | ||
209 | /// <summary> | ||
210 | /// | ||
211 | /// </summary> | ||
212 | // ----------------------------------------------------------------- | ||
176 | public int ArrayLength(string expr) | 213 | public int ArrayLength(string expr) |
177 | { | 214 | { |
178 | Stack<string> path; | 215 | Stack<string> path; |