MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / xml_escape

Method xml_escape

core/string/ustring.cpp:4770–4785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4768}
4769
4770String String::xml_escape(bool p_escape_quotes) const {
4771 String str = *this;
4772 str = str.replace("&", "&");
4773 str = str.replace("<", "&lt;");
4774 str = str.replace(">", "&gt;");
4775 if (p_escape_quotes) {
4776 str = str.replace("'", "&apos;");
4777 str = str.replace("\"", "&quot;");
4778 }
4779 /*
4780for (int i=1;i<32;i++) {
4781 char chr[2]={i,0};
4782 str=str.replace(chr,"&#"+String::num(i)+";");
4783}*/
4784 return str;
4785}
4786
4787static _FORCE_INLINE_ int _xml_unescape(const char32_t *p_src, int p_src_len, char32_t *p_dst) {
4788 int len = 0;

Callers 7

bbcode_to_xmlMethod · 0.80
dict_to_xmlrpcFunction · 0.80
export_annotationsMethod · 0.80
_write_method_docFunction · 0.80
save_classesMethod · 0.80
_android_xml_escapeFunction · 0.80
test_string.hFile · 0.80

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected