On 07/10/13 11:32, Daniel-Constantin Mierla wrote:
Are there pretty-printing tools for bencode? Or just
'gateways' to
json/xml pretty-printing.
There's an online one here:
http://pauw.student.utwente.nl/bencode.html
Or you can easily make one yourself. For example in Perl, using one of
the existing bencode modules, it's about a 2-liner script. Same in PHP,
or Python, or ...
I was referring to post-processing -- i.e., do the
queries periodically
or for each call at the end, store the results in a storage system and
then generate reports. With json, in some systems you can simply refer
to it as a structure, like:
result.totals.input.rtp.bytes>1000
This kind of operations makes very easy generating reports.
I'm not sure I understand the problem. In order to access elements of a
JSON object, the whole JSON string has to be parsed and processed. The
same is true for bencode. After decoding, elements can be accessed in
whatever way the language and library used supports. There's no reason
why bencode data can't be accessed the same way JSON data can be
accessed. The structure of the data is the same.
Unless you're talking about an immutable system which only supports but
can't support JSON. In that case you can either directly translate
bencode to JSON, or teach either the RTP proxy or the module to also
produce JSON output when needed. But I'm not familiar with any such
systems, so can't really provide any useful input.
cheers