i meant JPath not JQuery.<br><br><div class="gmail_quote">On Wed, Jan 30, 2013 at 8:57 AM, Mic Bowman <span dir="ltr"><<a href="mailto:cmickeyb@gmail.com" target="_blank">cmickeyb@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think that would be very useful. I can add it this afternoon, if you don't beat me to it.<div><br></div><div>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:</div>
<div><br></div><div>integer i = 0;</div><div>while (i < 10)</div><div>{</div><div> string p = osFormatString("foo[{0}].bar",[i]); // create path "foo[0].bar"</div><div> string v = JsonGetValue(storeID,p);</div>
<div>}</div><div><br></div><div>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.</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>--mic</div></font></span><div class="HOEnZb"><div class="h5"><div><br></div><div><br></div><div><div><br></div><div><br><div class="gmail_quote">On Tue, Jan 29, 2013 at 10:03 PM, Justin Clark-Casey <span dir="ltr"><<a href="mailto:jjustincc@googlemail.com" target="_blank">jjustincc@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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.<br>
<br>
Do you think it would be appropriate to add a function for that? Perhaps JsonTestStore(), which is in keeping with JsonTestPath()?<span><font color="#888888"><br>
<br>
-- <br>
Justin Clark-Casey (justincc)<br>
OSVW Consulting<br>
<a href="http://justincc.org" target="_blank">http://justincc.org</a><br>
<a href="http://twitter.com/justincc" target="_blank">http://twitter.com/justincc</a><br>
______________________________<u></u>_________________<br>
Opensim-dev mailing list<br>
<a href="mailto:Opensim-dev@lists.berlios.de" target="_blank">Opensim-dev@lists.berlios.de</a><br>
<a href="https://lists.berlios.de/mailman/listinfo/opensim-dev" target="_blank">https://lists.berlios.de/<u></u>mailman/listinfo/opensim-dev</a><br>
</font></span></blockquote></div><br></div></div>
</div></div></blockquote></div><br>