| The Gaudi Framework v30r0 (c919700c)

- 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 HistoryObj::convert_string( const std::string& input_string )
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( "&amp;" );
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
59 const CLID& HistoryObj::classID()
60 {
61
62 static const CLID CLID_HistoryObj = 86452397;
63 return CLID_HistoryObj;
64 }
65
66 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
67
68 // Output stream.
69
70 std::ostream& operator<<( std::ostream& lhs, const HistoryObj& rhs )
71 {
72 rhs.dump( lhs, false );
73 return lhs;
74 }
HistoryObj::classID
static const CLID & classID()
Definition: HistoryObj.cpp:59
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:70
std::string
STL class.
std::string::append
T append(T...args)
HistoryObj::indent
virtual void indent(std::ostream &, int) const
Definition: HistoryObj.cpp:49
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:20
Property.h
std::ostream
STL class.