Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
G4FRofstream Class Reference

#include <G4FRofstream.hh>

Public Types

enum  { SEND_BUFMAX = 1024 }
 

Public Member Functions

 G4FRofstream ()
 
 G4FRofstream (const char *filename)
 
virtual ~G4FRofstream ()
 
void Open (const char *filename)
 
void Close ()
 
G4bool IsOpen ()
 
void SendLine (const char *string)
 

Static Public Member Functions

static G4bool DoesFileExist (const char *filename)
 

Protected Attributes

G4bool flag_file_open
 
std::ofstream fout
 

Detailed Description

Definition at line 43 of file G4FRofstream.hh.

Member Enumeration Documentation

anonymous enum
Enumerator
SEND_BUFMAX 

Definition at line 46 of file G4FRofstream.hh.

Constructor & Destructor Documentation

G4FRofstream::G4FRofstream ( )
inline

Definition at line 51 of file G4FRofstream.hh.

References flag_file_open.

51 { flag_file_open = false ; }
G4bool flag_file_open
Definition: G4FRofstream.hh:69
G4FRofstream::G4FRofstream ( const char *  filename)
inline

Definition at line 112 of file G4FRofstream.hh.

References flag_file_open, and Open().

113 {
114  flag_file_open = false ;
115  Open( filename );
116 }
void Open(const char *filename)
Definition: G4FRofstream.hh:74
G4bool flag_file_open
Definition: G4FRofstream.hh:69
G4FRofstream::~G4FRofstream ( )
inlinevirtual

Definition at line 119 of file G4FRofstream.hh.

References Close().

120 {
121  Close() ;
122 }

Member Function Documentation

void G4FRofstream::Close ( )
inline

Definition at line 83 of file G4FRofstream.hh.

References flag_file_open, fout, and IsOpen().

Referenced by G4DAWNFILEViewer::ClearView(), G4DAWNFILESceneHandler::EndSavingG4Prim(), and ~G4FRofstream().

84 {
85  if( IsOpen() ) {
86  fout.close();
87  flag_file_open = false ;
88  }
89 }
G4bool IsOpen()
Definition: G4FRofstream.hh:60
G4bool flag_file_open
Definition: G4FRofstream.hh:69
std::ofstream fout
Definition: G4FRofstream.hh:70
G4bool G4FRofstream::DoesFileExist ( const char *  filename)
inlinestatic

Definition at line 99 of file G4FRofstream.hh.

References status.

Referenced by G4DAWNFILEViewer::ShowView().

100 {
101  G4bool status = false ;
102 
103  std::ifstream fout_tmp( filename ) ;
104  if( fout_tmp ) { status = true ; }
105  fout_tmp.close();
106 
107  return status ;
108 }
bool G4bool
Definition: G4Types.hh:79
int status
Definition: tracer.cxx:24
G4bool G4FRofstream::IsOpen ( )
inline
void G4FRofstream::Open ( const char *  filename)
inline

Definition at line 74 of file G4FRofstream.hh.

References flag_file_open, fout, and IsOpen().

Referenced by G4DAWNFILESceneHandler::BeginSavingG4Prim(), G4DAWNFILEViewer::ClearView(), and G4FRofstream().

75 {
76  if( !IsOpen() ) {
77  fout.open( filename ) ;
78  flag_file_open = true ;
79  }
80 }
G4bool IsOpen()
Definition: G4FRofstream.hh:60
G4bool flag_file_open
Definition: G4FRofstream.hh:69
std::ofstream fout
Definition: G4FRofstream.hh:70
void G4FRofstream::SendLine ( const char *  string)
inline

Definition at line 91 of file G4FRofstream.hh.

References fout, G4endl, and IsOpen().

92 {
93  if ( IsOpen() ) {
94  fout << message << G4endl;
95  }
96 }
G4bool IsOpen()
Definition: G4FRofstream.hh:60
#define G4endl
Definition: G4ios.hh:61
std::ofstream fout
Definition: G4FRofstream.hh:70

Field Documentation

G4bool G4FRofstream::flag_file_open
protected

Definition at line 69 of file G4FRofstream.hh.

Referenced by Close(), G4FRofstream(), IsOpen(), and Open().

std::ofstream G4FRofstream::fout
protected

Definition at line 70 of file G4FRofstream.hh.

Referenced by Close(), Open(), and SendLine().


The documentation for this class was generated from the following file: