| The Gaudi Framework v32r1 (f65d50dc)

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