The Gaudi Framework  master (da3d77e1)
HistoryObj.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 //====================================================================
12 // History.cpp
13 //--------------------------------------------------------------------
14 //
15 // Description: Implementation of HistoryObj base class
16 //
17 // Author : Charles Leggett
18 //====================================================================
19 
20 #define GAUDIKERNEL_HISTORYOBJ_CPP
21 
22 #include <Gaudi/Property.h>
23 #include <GaudiKernel/HistoryObj.h>
24 
25 using namespace std;
26 
27 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
28 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
29 
31 
32  // Conversion of special characteres into xml language
33 
34  std::string modified_string;
35 
36  for ( const auto& itr : input_string ) {
37  if ( itr == '&' )
38  modified_string.append( "&amp;" );
39  else if ( itr == '<' )
40  modified_string.append( "&lt;" );
41  else if ( itr == '>' )
42  modified_string.append( "&gt;" );
43  else if ( itr == '"' )
44  modified_string.append( "&quot;" );
45  else if ( itr == '\'' )
46  modified_string.append( "&apos;" );
47  else
48  modified_string += itr;
49  }
50 
51  return modified_string;
52 }
53 
54 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
55 
56 void HistoryObj::indent( std::ostream& ost, int i ) const {
57  while ( i > 0 ) {
58  ost << " ";
59  --i;
60  }
61 }
62 
63 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
64 
66 
67  static const CLID CLID_HistoryObj = 86452397;
68  return CLID_HistoryObj;
69 }
70 
71 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
HistoryObj::classID
static const CLID & classID()
Definition: HistoryObj.cpp:65
std::string
STL class.
std::ostream
STL class.
HistoryObj::indent
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:56
HistoryObj::convert_string
static std::string convert_string(const std::string &)
Definition: HistoryObj.cpp:30
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
std::string::append
T append(T... args)
HistoryObj.h
std
STL namespace.
Property.h