[#BloombergLP-bslalg-RbTreeUtil-printTreeStructure] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/RbTreeUtil.adoc[RbTreeUtil]::printTreeStructure :relfileprefix: ../../../ :mrdocs: Write a human‐readable description of `subtree` to `file`. == Synopsis Declared in `<bslalg_rbtreeutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void printTreeStructure( FILE* file, xref:BloombergLP/bslalg/RbTreeNode.adoc[RbTreeNode] const* subtree, void(* printNodeValueCallback)(FILE*, xref:BloombergLP/bslalg/RbTreeNode.adoc[RbTreeNode] const*), int level = 0, int spacesPerLevel = 4); ---- == Description Write a description of the structure of the specified `subtree` to the specified output `file` in a human‐readable format, using the specified `printValueCallback` to render the value of each node. Optionally specify an initial indentation `level`, whose absolute value is incremented recursively for nested objects. If `level` is specified, optionally specify `spacesPerLevel`, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects. If `level` is negative, suppress indentation of the first line. If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`). The behavior is undefined unless `node` is 0, or the root of a valid binary tree. Note that the implementation of this function is recursive and expensive to perform, it is intended for debugging purposes only. Also note that the format is not fully specified, and can change without notice. == Parameters [cols="1,4"] |=== | Name| Description | *file* | output stream that receives the description | *subtree* | root of the subtree to print, or 0 | *printNodeValueCallback* | callback that prints each node's value | *level* | initial indentation level | *spacesPerLevel* | spaces used for each indentation level |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#