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 
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== '&') modified_string.append("&");
29  else if (itr== '<') modified_string.append("&lt;");
30  else if (itr== '>') modified_string.append("&gt;");
31  else if (itr== '"') modified_string.append("&quot;");
32  else if (itr== '\'') modified_string.append("&apos;");
33  else if (itr== '\"') modified_string.append("&quot;");
34  else modified_string+=itr;
35  }
36 
37  return modified_string;
38 }
39 
40 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
41 
42 void
43 HistoryObj::indent(std::ostream& ost, int i) const {
44  while (i > 0) { ost << " "; --i; }
45 }
46 
47 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
48 
49 const CLID&
51 
52  static const CLID CLID_HistoryObj = 86452397;
53  return CLID_HistoryObj;
54 
55 }
56 
57 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
58 
59 // Output stream.
60 
62  rhs.dump(lhs,false);
63  return lhs;
64 }
static const CLID & classID()
Definition: HistoryObj.cpp:50
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:61
STL class.
T append(T...args)
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:43
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
static std::string convert_string(const std::string &)
Definition: HistoryObj.cpp:21
STL class.