MCPcopy Create free account
hub / github.com/assimp/assimp / ConvertName

Function ConvertName

code/AssetLib/Assxml/AssxmlFileWriter.cpp:94–118  ·  view source on GitHub ↗

----------------------------------------------------------------------------------- Convert a name to standard XML format

Source from the content-addressed store, hash-verified

92// -----------------------------------------------------------------------------------
93// Convert a name to standard XML format
94static void ConvertName(aiString &out, const aiString &in) {
95 out.length = 0;
96 for (unsigned int i = 0; i < in.length; ++i) {
97 switch (in.data[i]) {
98 case '<':
99 out.Append("&lt;");
100 break;
101 case '>':
102 out.Append("&gt;");
103 break;
104 case '&':
105 out.Append("&amp;");
106 break;
107 case '\"':
108 out.Append("&quot;");
109 break;
110 case '\'':
111 out.Append("&apos;");
112 break;
113 default:
114 out.data[out.length++] = in.data[i];
115 }
116 }
117 out.data[out.length] = 0;
118}
119
120// -----------------------------------------------------------------------------------
121// Write a single node as text dump

Callers 2

WriteNodeFunction · 0.85
WriteDumpFunction · 0.85

Calls 1

AppendMethod · 0.45

Tested by

no test coverage detected