class TGRedirectOutputGuard


TGRedirectOutputGuard

This class provides output redirection to a TGTextView in guaranteed
exception safe way. Use like this:
{
TGRedirectOutputGuard guard(textview);
... // do something
guard.Update();
... // do something else
}
when guard goes out of scope, Update() is called to flush what left
on the screed and the output is automatically redirected again to
the standard units.
The exception mechanism takes care of calling the dtors
of local objects so it is exception safe.
Optionally the output can also be saved into a file:
{
TGRedirectOutputGuard guard(textview, file, mode);
... // do something
}


Function Members (Methods)

public:
TGRedirectOutputGuard(const TGRedirectOutputGuard&)
TGRedirectOutputGuard(TGTextView* tv, const char* flog = 0, const char* mode = "a")
virtual~TGRedirectOutputGuard()
static TClass*Class()
virtual TClass*IsA() const
TGRedirectOutputGuard&operator=(const TGRedirectOutputGuard&)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
voidUpdate()

Data Members

private:
TStringfLogFile
FILE*fLogFileRead
TGTextView*fTextView
Bool_tfTmpFile

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TGRedirectOutputGuard(TGTextView* tv, const char* flog = 0, const char* mode = "a")
 Create output redirection guard.
 The TGTextView instance should be initialized outside.
 Text is added to the existing text in the frame.
 If defined, 'flog' is interpreted as the path of a file
 where to save the output; in such a case 'mode' if the
 opening mode of the file (either "w" or "a").
 By default a temporary file is used.
~TGRedirectOutputGuard()
 Destructor.
void Update()
 Send to text frame the undisplayed content of the file.
TGRedirectOutputGuard(TGTextView* tv, const char* flog = 0, const char* mode = "a")

Author: G. Ganis 10/10/2005
Last change: root/gui:$Id: TGRedirectOutputGuard.h 23115 2008-04-10 13:35:37Z rdm $
Last generated: 2008-06-25 08:42
Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.