FACT++  1.0
bool DataWriteRaw::Close ( )

Definition at line 92 of file DataWriteRaw.cc.

References Error(), and str.

Referenced by Close(), and ~DataWriteRaw().

93 {
94  WriteBlockHeader(kEndOfFile, 0, 0, 0);
95 
96  /*
97  if (tail)
98  {
99  fOut.seekp(fPosTail);
100 
101  WriteValue(uint32_t(1));
102  fOut.write(reinterpret_cast<const char*>(tail), sizeof(RUN_TAIL));
103  }*/
104 
105  if (!fOut)
106  {
107  ostringstream str;
108 
109  str << "ofstream::write() failed for '" << GetFileName() << "': " << strerror(errno) << " [errno=" << errno << "]";
110  Error(str);
111 
112  return false;
113  }
114 
115  fOut.close();
116 
117  if (!fOut)
118  {
119  ostringstream str;
120  str << "ofstream::close() failed for '" << GetFileName() << "': " << strerror(errno) << " [errno=" << errno << "]";
121  Error(str);
122 
123  return false;
124  }
125 
126  return true;
127 }
std::ofstream fOut
Definition: DataWriteRaw.h:8
char str[80]
Definition: test_client.c:7
void WriteBlockHeader(uint32_t type, uint32_t ver, uint32_t cnt, uint32_t len)
Definition: DataWriteRaw.cc:8
int Error(const std::string &str)
Definition: MessageImp.h:49
const std::string & GetFileName() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function: