Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

prprint.hpp File Reference


Detailed Description

pretty printing of an S-expression

See the pretty_print function decription

Definition in file prprint.hpp.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef bool(* prettyprint_callback_function )(const char *, void *)

Functions

bool pretty_print (SReference ref, prettyprint_callback_function fun, void *userdata, int indent=0, int margin=75, int indentstep=4)
 Pretty print an S-expression.


Typedef Documentation

typedef bool(* prettyprint_callback_function)(const char *, void *)
 

Definition at line 27 of file prprint.hpp.


Function Documentation

bool pretty_print SReference  ref,
prettyprint_callback_function  fun,
void *  userdata,
int  indent = 0,
int  margin = 75,
int  indentstep = 4
 

Pretty print an S-expression.

Lists are printed on one line if they fit the line, otherwise they get printed one item per line, indented.

Parameters:
ref is the expression to print
fun is the function which is capable of printing strings; actually, it can do anything with the string, e.g. printing, storing, converting to graphics etc.
userdata is arbitrary data to pass to the callback function, such as a stream (FILE*) or whatever you need
indent is the starting indentation
margin is the right margin
indentstep is how many spaces to use to indent inner blocks

Definition at line 30 of file prprint.cpp.

References SString::c_str(), SExpressionCons::Car(), SExpressionCons::Cdr(), SReference::DynamicCastGetPtr(), SReference::IsEmptyList(), SString::length(), and pretty_print().

Referenced by pretty_print().


Generated on Tue Dec 18 00:40:06 2007 for InteLib by  doxygen 1.4.1