Go to the source code of this file.
◆ escape_char()
static const char * escape_char |
( |
char |
c, |
|
|
char |
storage[2] |
|
) |
| |
|
static |
Definition at line 88 of file SkXMLWriter.cpp.
88 {
89 static const char* gEscapeChars[] = {
90 "<<",
91 ">>",
92
93
94 "&&"
95 };
96
97 const char** array = gEscapeChars;
98 for (unsigned i = 0; i < std::size(gEscapeChars); i++) {
99 if (array[i][0] == c) {
100 return &array[i][1];
101 }
102 }
103 storage[0] = c;
104 storage[1] = 0;
105 return storage;
106}
◆ escape_markup()
static size_t escape_markup |
( |
char |
dst[], |
|
|
const char |
src[], |
|
|
size_t |
length |
|
) |
| |
|
static |
Definition at line 108 of file SkXMLWriter.cpp.
108 {
109 size_t extra = 0;
111
112 while (src < stop) {
113 char orig[2];
115 size_t seqSize = strlen(seq);
116
117 if (dst) {
118 memcpy(dst, seq, seqSize);
120 }
121
122
123 extra += seqSize - 1;
124
125
127 }
128 return extra;
129}
static const char * escape_char(char c, char storage[2])
◆ write_dom()
Definition at line 152 of file SkXMLWriter.cpp.
152 {
153 if (!skipRoot) {
154 const char* elem =
dom.getName(node);
157 w->addText(elem, strlen(elem));
158 return;
159 }
160
161 w->startElement(elem);
162
166 while ((
name = iter.next(&value)) !=
nullptr) {
167 w->addAttribute(
name, value);
168 }
169 }
170
171 node =
dom.getFirstChild(node,
nullptr);
172 while (node) {
174 node =
dom.getNextSibling(node,
nullptr);
175 }
176
177 if (!skipRoot) {
179 }
180}
static void write_dom(const SkDOM &dom, const SkDOM::Node *node, SkXMLWriter *w, bool skipRoot)