The Gaudi Framework  v30r3 (a5ef0a68)
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 
23  // Conversion of special characteres into xml language
24 
25  std::string modified_string;
26 
27  for ( const auto& itr : input_string ) {
28  if ( itr == '&' )
29  modified_string.append( "&" );
30  else if ( itr == '<' )
31  modified_string.append( "&lt;" );
32  else if ( itr == '>' )
33  modified_string.append( "&gt;" );
34  else if ( itr == '"' )
35  modified_string.append( "&quot;" );
36  else if ( itr == '\'' )
37  modified_string.append( "&apos;" );
38  else if ( itr == '\"' )
39  modified_string.append( "&quot;" );
40  else
41  modified_string += itr;
42  }
43 
44  return modified_string;
45 }
46 
47 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
48 
49 void HistoryObj::indent( std::ostream& ost, int i ) const
50 {
51  while ( i > 0 ) {
52  ost << " ";
53  --i;
54  }
55 }
56 
57 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
58 
60 {
61 
62  static const CLID CLID_HistoryObj = 86452397;
63  return CLID_HistoryObj;
64 }
65 
66 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
67 
68 // Output stream.
69 
71 {
72  rhs.dump( lhs, false );
73  return lhs;
74 }
static const CLID & classID()
Definition: HistoryObj.cpp:59
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:70
STL class.
T append(T...args)
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:49
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
static std::string convert_string(const std::string &)
Definition: HistoryObj.cpp:20
STL class.