CMS 3D CMS Logo

Functions
FWConfiguration.cc File Reference
#include <stdexcept>
#include <algorithm>
#include <boost/bind.hpp>
#include "Fireworks/Core/interface/FWConfiguration.h"

Go to the source code of this file.

Functions

std::string attrEscape (std::string value)
 

Function Documentation

◆ attrEscape()

std::string attrEscape ( std::string  value)

Helper function to make sure we escape correctly xml entities embedded in the string value.

Definition at line 140 of file FWConfiguration.cc.

140  {
142  index = 0;
143  while (std::string::npos != (index = value.find('&', index))) {
144  value.replace(index, 1, "&amp;", 5);
145  // Do not check "&quot;" for quotes.
146  index += 5;
147  }
148 
149  while (std::string::npos != (index = value.find('"', index))) {
150  value.replace(index, 1, "&quot;", 6);
151  // Do not check "&quot;" for quotes.
152  index += 6;
153  }
154 
155  index = 0;
156  while (std::string::npos != (index = value.find('<', index))) {
157  value.replace(index, 1, "&lt;", 4);
158  // Do not check "&quot;" for quotes.
159  index += 4;
160  }
161 
162  index = 0;
163  while (std::string::npos != (index = value.find('>', index))) {
164  value.replace(index, 1, "&gt;", 4);
165  // Do not check "&quot;" for quotes.
166  index += 4;
167  }
168 
169  return value;
170 }

References relativeConstraints::value.

Referenced by FWConfiguration::streamTo().

trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
value
Definition: value.py:1
relativeConstraints.value
value
Definition: relativeConstraints.py:53
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46