[Opensim-dev] Add a JsonTestStore() for the JSON store module?
Mic Bowman
cmickeyb at gmail.com
Wed Jan 30 22:48:51 UTC 2013
Done.
On Wed, Jan 30, 2013 at 8:57 AM, Mic Bowman <cmickeyb at gmail.com> wrote:
> I think that would be very useful. I can add it this afternoon, if you
> don't beat me to it.
>
> When I wrote the interface to the Json store, I modeled the path expansion
> after JQuery interface. However, I'm finding that really challenging to use
> for iterating through an array of values. Right now, I use osFormatString
> to create the path dynamically. For example:
>
> integer i = 0;
> while (i < 10)
> {
> string p = osFormatString("foo[{0}].bar",[i]); // create path
> "foo[0].bar"
> string v = JsonGetValue(storeID,p);
> }
>
> If you have any suggestions for a construct that would make the iteration
> cleaner, I would be very interested. I've bounced around (and written some
> test code) for taking a list (the components of the path) as an argument,
> but constructing the list is no easier than constructing the string. I've
> also poked around with creating store handles that point into an existing
> store (so you resolve the path "foo" into a store handle then iterate at
> the top level). Again, the code to walk through the structure is still
> excessively complex.
>
> --mic
>
>
>
>
> On Tue, Jan 29, 2013 at 10:03 PM, Justin Clark-Casey <
> jjustincc at googlemail.com> wrote:
>
>> Hi Mic. Whilst looking through these functions tonight, it struck me
>> that there doesn't appear to be a way to tell if a certain JSON store still
>> exists, as identified by its key.
>>
>> Do you think it would be appropriate to add a function for that? Perhaps
>> JsonTestStore(), which is in keeping with JsonTestPath()?
>>
>> --
>> Justin Clark-Casey (justincc)
>> OSVW Consulting
>> http://justincc.org
>> http://twitter.com/justincc
>> ______________________________**_________________
>> Opensim-dev mailing list
>> Opensim-dev at lists.berlios.de
>> https://lists.berlios.de/**mailman/listinfo/opensim-dev<https://lists.berlios.de/mailman/listinfo/opensim-dev>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20130130/d1d69a5d/attachment-0001.html>
More information about the Opensim-dev
mailing list