Several methods of “Post” Module allow to manipulate the information and warning messages issued by FeResPost. In C++ code, the messages are saved into a C++ ostrstream object. At the end of each FeResPost method, the content of this stream is flushed into the output selected by the client. Several methods allow to control how information and warning messages are output:
“setInfoStreamToKeep” just keeps the information and warning messages in the ostrstream. Nothing is written to selected output.
“setInfoStreamToNone” clears the ostrstream at the end of each FeResPost method but does not write its content anywhere.
“setInfoStreamToClientStream” sets the output to a client (ruby in this case) output stream. The argument is client output stream. For ruby, it may correspond to stderr or a file that has been opened for writing.
“setInfoStreamToCppStream” sets the output to a standard C++ stream. Arguments is a String identifying the output stream. Two values are accepted: “std::cout” and “std::cerr”.
“setInfoStreamToCppFile” selects an output corresponding to a C++ output file that is opened by FeResPost. The method has one or two arguments:
“FileName” is a String that contains the path to file that must be opened for writing.
“Mode” is a String that contains the opening mode for opening the output file. Accepted values are “w” and “w+”. This argument is optional. Default opening mode is “w”.
“getInfoStreamContent” returns a String containing the content of information ostrstream. This method can be used when the output has been set to “keep” with “setInfoStreamToKeep” method.
“clearInfoStreamContent” clears the content of information ostrstream. This method can be used when the output has been set to “keep” with “setInfoStreamToKeep” method.
“getAndClearInfoStreamContent” returns a String containing the content of information ostrstream and clears the content of this ostrstream. (This method combines methods “getInfoStreamContent” and “clearInfoStreamContent”.) Again, this method can be used when the output has been set to “keep” with “setInfoStreamToKeep” method.
The default standard output generally corresponds to clients (ruby, in this case) standard output. This selection is done when FeResPost library is loaded.
The redirection of standard output is useful when FeResPost is not run in “console” mode. Moreover, it is sometimes useful to separate the outputs of FeResPost from those of the ruby post-processing program. Two methods allow adding content in the selected output stream: