www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How pretty-print a struct?

reply ZZ <ZZ zz.com> writes:
Hi,

Is there an easy way to pretty-print a struct which also includes 
arrays?

pretty_array does a very good job for arrays.

ZZ
Mar 30 2022
parent reply mw <mingwu gmail.com> writes:
On Thursday, 31 March 2022 at 06:35:15 UTC, ZZ wrote:
 Hi,

 Is there an easy way to pretty-print a struct which also 
 includes arrays?

 pretty_array does a very good job for arrays.
If you want the field variable names in the output, you can use: https://code.dlang.org/packages/jdiutil https://code.dlang.org/packages/boilerplate
Mar 31 2022
parent ZZ <zz zz.com> writes:
On Thursday, 31 March 2022 at 16:08:19 UTC, mw wrote:
 On Thursday, 31 March 2022 at 06:35:15 UTC, ZZ wrote:
 Hi,

 Is there an easy way to pretty-print a struct which also 
 includes arrays?

 pretty_array does a very good job for arrays.
If you want the field variable names in the output, you can use: https://code.dlang.org/packages/jdiutil https://code.dlang.org/packages/boilerplate
Thanks.
Mar 31 2022