Belle II Software light-2406-ragdoll
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
13using namespace std;
14using namespace Belle2;
15
16
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}
std::string getContent() const
Read the content of the payload (text) file.
Definition: PayloadFile.cc:17
std::string m_fileName
Name of the payload file.
Definition: PayloadFile.h:44
Abstract base class for different kinds of events.
Definition: ClusterUtils.h:24
STL namespace.