Belle II Software light-2406-ragdoll
KeyValuePrinter.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/utilities/KeyValuePrinter.h>
10#include <boost/property_tree/json_parser.hpp>
11
12using namespace Belle2;
13
14std::string KeyValuePrinter::escape(const std::string& value) const
15{
16 using namespace boost::property_tree::json_parser;
17
18 if (m_json)
19 return "\"" + create_escapes(value) + "\"";
20 else
21 return value;
22}
std::string escape(const std::string &value) const
escape string.
bool m_json
create JSON output?
Abstract base class for different kinds of events.
Definition: ClusterUtils.h:24