Geant4 11.2.2
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 36 of file G4FRofstream.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SEND_BUFMAX 

Definition at line 39 of file G4FRofstream.hh.

40 {
41 SEND_BUFMAX = 1024
42 };

Constructor & Destructor Documentation

◆ G4FRofstream() [1/2]

G4FRofstream::G4FRofstream ( )
inline

Definition at line 46 of file G4FRofstream.hh.

46{ flag_file_open = false; }
G4bool flag_file_open

◆ G4FRofstream() [2/2]

G4FRofstream::G4FRofstream ( const char * filename)
inline

Definition at line 108 of file G4FRofstream.hh.

109{
110 flag_file_open = false;
111 Open(filename);
112}
void Open(const char *filename)

◆ ~G4FRofstream()

G4FRofstream::~G4FRofstream ( )
inlinevirtual

Definition at line 114 of file G4FRofstream.hh.

114{ Close(); }

Member Function Documentation

◆ Close()

void G4FRofstream::Close ( )
inline

Definition at line 77 of file G4FRofstream.hh.

78{
79 if(IsOpen())
80 {
81 fout.close();
82 flag_file_open = false;
83 }
84}
G4bool IsOpen()
std::ofstream fout

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

◆ DoesFileExist()

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

Definition at line 94 of file G4FRofstream.hh.

95{
96 G4bool status = false;
97
98 std::ifstream fout_tmp(filename);
99 if(fout_tmp)
100 {
101 status = true;
102 }
103 fout_tmp.close();
104
105 return status;
106}
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 68 of file G4FRofstream.hh.

69{
70 if(!IsOpen())
71 {
72 fout.open(filename);
73 flag_file_open = true;
74 }
75}

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

◆ SendLine()

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

Definition at line 86 of file G4FRofstream.hh.

87{
88 if(IsOpen())
89 {
90 fout << message << G4endl;
91 }
92}
#define G4endl
Definition G4ios.hh:67

Member Data Documentation

◆ flag_file_open

G4bool G4FRofstream::flag_file_open
protected

Definition at line 64 of file G4FRofstream.hh.

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

◆ fout

std::ofstream G4FRofstream::fout
protected

Definition at line 65 of file G4FRofstream.hh.

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


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