Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 42 of file G4FRofstream.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SEND_BUFMAX 

Definition at line 45 of file G4FRofstream.hh.

45{ SEND_BUFMAX = 1024 };

Constructor & Destructor Documentation

◆ G4FRofstream() [1/2]

G4FRofstream::G4FRofstream ( )
inline

Definition at line 50 of file G4FRofstream.hh.

50{ flag_file_open = false ; }
G4bool flag_file_open
Definition: G4FRofstream.hh:68

◆ G4FRofstream() [2/2]

G4FRofstream::G4FRofstream ( const char *  filename)
inline

Definition at line 111 of file G4FRofstream.hh.

112{
113 flag_file_open = false ;
114 Open( filename );
115}
void Open(const char *filename)
Definition: G4FRofstream.hh:73

◆ ~G4FRofstream()

G4FRofstream::~G4FRofstream ( )
inlinevirtual

Definition at line 118 of file G4FRofstream.hh.

119{
120 Close() ;
121}

Member Function Documentation

◆ Close()

void G4FRofstream::Close ( )
inline

Definition at line 82 of file G4FRofstream.hh.

83{
84 if( IsOpen() ) {
85 fout.close();
86 flag_file_open = false ;
87 }
88}
G4bool IsOpen()
Definition: G4FRofstream.hh:59
std::ofstream fout
Definition: G4FRofstream.hh:69

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

◆ DoesFileExist()

G4bool G4FRofstream::DoesFileExist ( const char *  filename)
inlinestatic

Definition at line 98 of file G4FRofstream.hh.

99{
100 G4bool status = false ;
101
102 std::ifstream fout_tmp( filename ) ;
103 if( fout_tmp ) { status = true ; }
104 fout_tmp.close();
105
106 return status ;
107}
bool G4bool
Definition: G4Types.hh:86

Referenced by G4DAWNFILEViewer::ShowView().

◆ IsOpen()

G4bool G4FRofstream::IsOpen ( )
inline

◆ Open()

void G4FRofstream::Open ( const char *  filename)
inline

Definition at line 73 of file G4FRofstream.hh.

74{
75 if( !IsOpen() ) {
76 fout.open( filename ) ;
77 flag_file_open = true ;
78 }
79}

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

◆ SendLine()

void G4FRofstream::SendLine ( const char *  string)
inline

Definition at line 90 of file G4FRofstream.hh.

91{
92 if ( IsOpen() ) {
93 fout << message << G4endl;
94 }
95}
#define G4endl
Definition: G4ios.hh:57

Member Data Documentation

◆ flag_file_open

G4bool G4FRofstream::flag_file_open
protected

Definition at line 68 of file G4FRofstream.hh.

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

◆ fout

std::ofstream G4FRofstream::fout
protected

Definition at line 69 of file G4FRofstream.hh.

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


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