ROOT
Version master
v6.36
v6.34
v6.32
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
►
Functional Parts
►
Namespaces
►
All Classes
▼
Files
▼
File List
►
bindings
▼
core
▼
base
►
doc
▼
inc
►
ROOT
►
Bswapcpy.h
►
Buttons.h
►
Bytes.h
►
Byteswap.h
►
GLConstants.h
Gtypes.h
Htypes.h
►
KeySymbols.h
►
Match.h
►
MessageTypes.h
RConfig.h
Riostream.h
Rpair.h
►
RQ_OBJECT.h
►
RStipples.h
►
Rtypes.h
►
RtypesImp.h
Strlen.h
►
TApplication.h
TAtt3D.h
TAttAxis.h
TAttBBox.h
TAttBBox2D.h
►
TAttFill.h
►
TAttLine.h
►
TAttMarker.h
TAttPad.h
►
TAttText.h
TBase64.h
►
TBenchmark.h
►
TBuffer.h
►
TBuffer3D.h
►
TBuffer3DTypes.h
►
TColor.h
►
TColorGradient.h
►
TDatime.h
►
TDirectory.h
►
TEnv.h
►
TException.h
TExec.h
TFileCollection.h
►
TFileInfo.h
TFolder.h
TInetAddress.h
TMacro.h
►
TMathBase.h
►
TMD5.h
TMemberInspector.h
TMessageHandler.h
TNamed.h
►
TNotifyLink.h
►
TObject.h
TObjString.h
TParameter.h
►
TPluginManager.h
►
TPoint.h
►
TPRegexp.h
►
TProcessID.h
TProcessUUID.h
►
TQClass.h
►
TQCommand.h
►
TQConnection.h
►
TQObject.h
►
TRedirectOutputGuard.h
TRef.h
TRefCnt.h
TRegexp.h
TRemoteObject.h
►
TROOT.h
►
TRootIOCtor.h
TStopwatch.h
►
TStorage.h
►
TString.h
►
TStringLong.h
►
TStyle.h
►
TSysEvtHandler.h
►
TSystem.h
TSystemDirectory.h
TSystemFile.h
TTask.h
►
TThreadSlots.h
►
TTime.h
TTimer.h
►
TTimeStamp.h
►
TUri.h
TUrl.h
►
TUUID.h
►
TVersionCheck.h
►
TVirtualAuth.h
TVirtualFFT.h
►
TVirtualGL.h
TVirtualMapFile.h
►
TVirtualMonitoring.h
►
TVirtualMutex.h
►
TVirtualPad.h
TVirtualPadEditor.h
TVirtualPadPainter.h
►
TVirtualPerfStats.h
►
TVirtualPS.h
►
TVirtualQConnection.h
►
TVirtualRWMutex.h
►
TVirtualTableInterface.h
TVirtualViewer3D.h
►
TVirtualX.h
►
Varargs.h
►
src
►
v7
►
clingutils
►
cont
►
dictgen
►
foundation
►
gui
►
imt
►
macosx
►
meta
►
metacling
►
multiproc
►
rint
►
testsupport
►
thread
►
unix
►
winnt
►
zip
►
documentation
►
geom
►
graf2d
►
graf3d
►
gui
►
hist
►
io
►
main
►
master
►
math
►
montecarlo
►
net
►
proof
►
roofit
►
sql
►
tmva
►
tree
►
tutorials
►
File Members
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
TRedirectOutputGuard.h
Go to the documentation of this file.
1
// @(#)root/base:$Id$
2
// Author: G. Ganis 10/10/2005
3
4
/*************************************************************************
5
* Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
#ifndef ROOT_TRedirectOutputGuard
13
#define ROOT_TRedirectOutputGuard
14
15
//////////////////////////////////////////////////////////////////////////
16
// //
17
// TRedirectOutputGuard //
18
// //
19
// This class provides output redirection to a file in a guaranteed //
20
// exception safe way. Use like this: //
21
// { //
22
// TRedirectOutputGuard guard(filelog, mode); //
23
// ... // do something //
24
// } //
25
// when guard goes out of scope output is automatically redirected to //
26
// the standard units in the TRedirectOutputGuard destructor. //
27
// The exception mechanism takes care of calling the dtors //
28
// of local objects so it is exception safe. //
29
// The 'mode' options follow the fopen write modes convention; default //
30
// is "a". //
31
// //
32
//////////////////////////////////////////////////////////////////////////
33
34
#include "
TSystem.h
"
35
36
class
TRedirectOutputGuard
{
37
38
public
:
39
TRedirectOutputGuard
(
const
char
*
fout
,
const
char
*
mode
=
"a"
)
40
{
gSystem
->
RedirectOutput
(
fout
,
mode
); }
41
virtual
~TRedirectOutputGuard
() {
gSystem
->
RedirectOutput
(
nullptr
); }
42
43
ClassDef
(
TRedirectOutputGuard
,0)
// Exception safe output redirection
44
};
45
46
#endif
ClassDef
#define ClassDef(name, id)
Definition
Rtypes.h:342
mode
Option_t Option_t TPoint TPoint const char mode
Definition
TGWin32VirtualXProxy.cxx:68
TSystem.h
gSystem
R__EXTERN TSystem * gSystem
Definition
TSystem.h:572
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TRedirectOutputGuard
Definition
TRedirectOutputGuard.h:36
TRedirectOutputGuard::~TRedirectOutputGuard
virtual ~TRedirectOutputGuard()
Definition
TRedirectOutputGuard.h:41
TRedirectOutputGuard::TRedirectOutputGuard
TRedirectOutputGuard(const char *fout, const char *mode="a")
Definition
TRedirectOutputGuard.h:39
TSystem::RedirectOutput
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=nullptr)
Redirect standard output (stdout, stderr) to the specified file.
Definition
TSystem.cxx:1727
core
base
inc
TRedirectOutputGuard.h
ROOT master - Reference Guide Generated on Tue Apr 22 2025 16:24:05 (GVA Time) using Doxygen 1.10.0