Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
JSONParser
#1
So I am trying to use the parser, I have a JSON response coming back from a POST to a URL using HTTP. The data comes back in a membuf. And I can extract it to a string.

How do I get that buffer data into a textinstream so that I can pass it to the JSONParser?
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#2
Just construct a StringInStream object with the string that you've transcoded the text into.
Dean Roddey
Explorans limites defectum
Reply
#3
This has been a bad day for me not getting it after reading complicated JSON docs...

Can you give me an example? How do I construct a variable with info in it? Don't I have to do that when I declare it in locals? Then it's fixed and I can't update it?...
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#4
Yeh, as it stands you'd have to use a local upon entry to the parsing method, and just create a new one each time your parse a reply. So you'd pass the string in that you've transcoded the info into, and set it on the stream on the way in as a local. I should probably provide a 'SetContent' method on the string in stream I guess to let you set new data on it and reset the position back to the start. For that matter I need to do a memory buffer based text input stream as well, to stream straight out of the memory buffer, given a transcoder of appropriate type.
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  JSONParser help dlmorgan999 10 6,278 02-26-2017, 07:51 PM
Last Post: dlmorgan999

Forum Jump:


Users browsing this thread: 1 Guest(s)