MCPcopy Create free account
hub / github.com/acl-dev/acl / test2

Function test2

lib_acl_cpp/samples/xml/xml.cpp:202–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202static void test2(void)
203{
204 acl::xml body;
205 body.get_root().add_child("test", true)
206 .add_attr("mail", "\"zsxxsz1\" zsxxsz1@test.com")
207 .add_attr("title", "��<��>��\'��</test>���\"�����\\\"")
208 .add_attr("from", "\"zsxxsz2\" zsxxsz2@test.com");
209 acl::string buf;
210 body.build_xml(buf);
211 printf("data: %s\r\n", buf.c_str());
212
213 printf("------------------------------------------\r\n");
214
215 acl::xml xml(buf.c_str());
216 const acl::xml_node* node = xml.getFirstElementByTag("test");
217 if (node == NULL)
218 printf("test tag null\r\n");
219 else
220 {
221 const char* mail = (*node)["mail"];
222 const char* title = (*node)["title"];
223 const char* from = (*node)["from"];
224 printf("mail: %s\r\n", mail ? mail : "null");
225 printf("title: %s\r\n", title ? title : "null");
226 printf("from: %s\r\n", from ? from : "null");
227 }
228}
229
230static void get_html(const char* file)
231{

Callers 1

mainFunction · 0.70

Calls 3

build_xmlMethod · 0.45
c_strMethod · 0.45
getFirstElementByTagMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…