Belle II Software  release-05-02-19
KeyValuePrinter.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Christian Pulvermacher *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <framework/utilities/KeyValuePrinter.h>
12 #include <boost/property_tree/json_parser.hpp>
13 
14 using namespace Belle2;
15 
16 std::string KeyValuePrinter::escape(const std::string& value) const
17 {
18  using namespace boost::property_tree::json_parser;
19 
20  if (m_json)
21  return "\"" + create_escapes(value) + "\"";
22  else
23  return value;
24 }
Belle2::KeyValuePrinter::escape
std::string escape(const std::string &value) const
escape string.
Definition: KeyValuePrinter.cc:16
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::KeyValuePrinter::m_json
bool m_json
create JSON output?
Definition: KeyValuePrinter.h:104