MCPcopy Create free account
hub / github.com/KLayout/klayout / escape_string

Function escape_string

src/laybasic/laybasic/gtf.cc:83–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81// Convert a string to a form suitable for XML output
82
83static std::string
84escape_string (const char *cp)
85{
86 std::string r;
87 r.reserve (strlen (cp) * 2);
88 while (*cp) {
89 if (*cp == '&') {
90 r += "&";
91 } else if (*cp == '<') {
92 r += "&lt;";
93 } else if (*cp == '>') {
94 r += "&gt;";
95 } else {
96 r += *cp;
97 }
98 ++cp;
99 }
100 return r;
101}
102
103// --------------------------------------------------------------
104// Widget to path conversion and back

Callers 4

write_dataFunction · 0.70
edit_button_clickedMethod · 0.50
info_clickedMethod · 0.50
rdbs_changedMethod · 0.50

Calls 1

reserveMethod · 0.45

Tested by

no test coverage detected