Mercurial > hg > orthanc
view Resources/Toolbox.lua @ 682:efc4928be6fb
Recover pixel data for more transfer syntaxes (notably JPEG)
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 30 Jan 2014 15:05:14 +0100 |
parents | b79bf2f4ab2e |
children | 649d47854314 |
line wrap: on
line source
--[[ PrintRecursive(struct, [limit], [indent]) Recursively print arbitrary data. Set limit (default 100) to stanch infinite loops. Indents tables as [KEY] VALUE, nested tables as [KEY] [KEY]...[KEY] VALUE Set indent ("") to prefix each line: Mytable [KEY] [KEY]...[KEY] VALUE Source: https://gist.github.com/stuby/5445834#file-rprint-lua --]] function PrintRecursive(s, l, i) -- recursive Print (structure, limit, indent) l = (l) or 100; i = i or ""; -- default item limit, indent string if (l<1) then print "ERROR: Item limit reached."; return l-1 end; local ts = type(s); if (ts ~= "table") then print (i,ts,s); return l-1 end print (i,ts); -- print "table" for k,v in pairs(s) do -- print "[KEY] VALUE" l = PrintRecursive(v, l, i.."\t["..tostring(k).."]"); if (l < 0) then break end end return l end print('Lua toolbox installed')