Belle II Software  release-08-01-10
PayloadFile.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <framework/database/PayloadFile.h>
10 #include <framework/logging/Logger.h>
11 #include <fstream>
12 
13 using namespace std;
14 using namespace Belle2;
15 
16 
17 string PayloadFile::getContent() const
18 {
19  ifstream file(m_fileName.c_str());
20  if (!file.is_open()) {
21  B2ERROR("Opening of payload file " << m_fileName << " failed.");
22  return "";
23  }
24  stringstream buffer;
25  buffer << file.rdbuf();
26  return buffer.str();
27 }
Abstract base class for different kinds of events.