| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
20 std::string
21 HistoryObj::convert_string(const std::string& input_string){
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("&amp;");
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&
50 HistoryObj::classID() {
51
52 static const CLID CLID_HistoryObj = 86452397;
53 return CLID_HistoryObj;
54
55 }
56
57 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
58
59 // Output stream.
60
61 std::ostream& operator<<(std::ostream& lhs, const HistoryObj& rhs) {
62 rhs.dump(lhs,false);
63 return lhs;
64 }
HistoryObj::classID
static const CLID & classID()
Definition: HistoryObj.cpp:50
std
STL namespace.
HistoryObj::dump
virtual void dump(std::ostream &, const bool isXML=false, int indent=0) const =0
HistoryObj
Base class for History Objects.
Definition: HistoryObj.h:21
HistoryObj.h
operator<<
std::ostream & operator<<(std::ostream &lhs, const HistoryObj &rhs)
Definition: HistoryObj.cpp:61
std::string
STL class.
std::string::append
T append(T...args)
HistoryObj::indent
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:43
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
HistoryObj::convert_string
static std::string convert_string(const std::string &)
Definition: HistoryObj.cpp:21
Property.h
std::ostream
STL class.