Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
HistoryObj.cpp
Go to the documentation of this file.
1 //====================================================================
2 // History.cpp
3 //--------------------------------------------------------------------
4 //
5 // Description: Implementation of HistoryObj base class
6 //
7 // Author : Charles Leggett
8 //====================================================================
9 
10 #define GAUDIKERNEL_HISTORYOBJ_CPP
11 
12 #include "GaudiKernel/HistoryObj.h"
13 #include "GaudiKernel/Property.h"
14 
15 using namespace std;
16 
17 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
18 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
19 
21 
22  // Conversion of special characteres into xml language
23 
24  std::string modified_string;
25 
26  for ( const auto& itr : input_string ) {
27  if ( itr == '&' )
28  modified_string.append( "&" );
29  else if ( itr == '<' )
30  modified_string.append( "&lt;" );
31  else if ( itr == '>' )
32  modified_string.append( "&gt;" );
33  else if ( itr == '"' )
34  modified_string.append( "&quot;" );
35  else if ( itr == '\'' )
36  modified_string.append( "&apos;" );
37  else
38  modified_string += itr;
39  }
40 
41  return modified_string;
42 }
43 
44 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
45 
46 void HistoryObj::indent( std::ostream& ost, int i ) const {
47  while ( i > 0 ) {
48  ost << " ";
49  --i;
50  }
51 }
52 
53 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
54 
56 
57  static const CLID CLID_HistoryObj = 86452397;
58  return CLID_HistoryObj;
59 }
60 
61 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
62 
63 // Output stream.
64 
66  rhs.dump( lhs, false );
67  return lhs;
68 }
static const CLID & classID()
Definition: HistoryObj.cpp:55
STL namespace.
virtual void dump(std::ostream &, const bool isXML=false, int indent=0) const =0
Base class for History Objects.
Definition: HistoryObj.h:21
std::ostream & operator<<(std::ostream &lhs, const HistoryObj &rhs)
Definition: HistoryObj.cpp:65
STL class.
T append(T...args)
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:46
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
static std::string convert_string(const std::string &)
Definition: HistoryObj.cpp:20
STL class.