To create dynamic nested maps from C++, the outter object (response) would have to return another intercepted object (e.g. body) that then returns the actual values on access.
On Fri, Jul 22, 2016 at 8:12 AM Abhishek Singh <singhabhishek....@gmail.com> wrote: > Hi, > > I’m wondering if there is a way to expose map<string, map<string, string> > > into JS world from C++? Exposing map<string, string> looks > straightforward and I’m doing for some C++ objects using > NamedPropertyConfigurationHandler. I’ll just show sample JS code that I > would like to have and where C++ map<string, map<string, string> > will > come into picture: > > function OnHTTPGet(request, response) { > > var city = “BLR”; > var limit = “10”; > > var queryResult = dbCal(“select * from users where city=${city} > limit ${limit}”); > > // This works for me presently > /* response.data = queryResult; > response.status_code = 200; */ > > // What I would like to have > response.body.data = queryResult; > response.header.status_code = 200; > } > > “request” - native HTTP request JSON passed from C++ V8 binding as args to > JS function > “response” - C++ based HTTP object exposed with Setter callback set using > NamedPropertyConfigHandler and this what I write back to user who made the > “request" > > I basically want to set HTTP response body and header transparently, which > would require me to expose C++ HTTP object probably as a map<string, > map<string, string> >. Hope my question is clear, please let me know if > there a way to do this? > > Thanks, > Abhishek > > -- > -- > v8-users mailing list > v8-users@googlegroups.com > http://groups.google.com/group/v8-users > --- > You received this message because you are subscribed to the Google Groups > "v8-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to v8-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.