The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
HistoryObj.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#include <Gaudi/Property.h>
13
14std::string HistoryObj::convert_string( const std::string& input_string ) {
15 // Conversion of special characteres into xml language
16
17 std::string modified_string;
18
19 for ( const auto& itr : input_string ) {
20 if ( itr == '&' )
21 modified_string.append( "&amp;" );
22 else if ( itr == '<' )
23 modified_string.append( "&lt;" );
24 else if ( itr == '>' )
25 modified_string.append( "&gt;" );
26 else if ( itr == '"' )
27 modified_string.append( "&quot;" );
28 else if ( itr == '\'' )
29 modified_string.append( "&apos;" );
30 else
31 modified_string += itr;
32 }
33
34 return modified_string;
35}
36
37void HistoryObj::indent( std::ostream& ost, int i ) const {
38 while ( i > 0 ) {
39 ost << " ";
40 --i;
41 }
42}
43
45 static const CLID CLID_HistoryObj = 86452397;
46 return CLID_HistoryObj;
47}
unsigned int CLID
Class ID definition.
Definition ClassID.h:16
static const CLID & classID()
virtual void indent(std::ostream &, int) const
static std::string convert_string(const std::string &)