Posts: 3,415
Threads: 158
Joined: Jan 2006
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?
Posts: 40,483
Threads: 491
Joined: Aug 2002
Just construct a StringInStream object with the string that you've transcoded the text into.
Dean Roddey
Explorans limites defectum
Posts: 3,415
Threads: 158
Joined: Jan 2006
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?...
Posts: 40,483
Threads: 491
Joined: Aug 2002
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