-- 新建一个help
local helpXmlTest = CSelectHelp();
helpXmlTest:addField('name');
helpXmlTest:addField('age');
for i=0,2 do
    local v = CVector();
    v:push_back('name' .. i);
    v:push_back(20+i);
    helpXmlTest:addVectorValue(v);
end

-- 插入一个新的属性值,help中的所有列都会变成属性名和属性值
xmlCutil:insert('students.class', 'help_name', helpXmlTest);
print(xmlCutil:toString());


local itIn = CIntent();
itIn:set('set_1','value1');
itIn:set('set_2','value2');
itIn:set('set_3','value3');
-- 插入节点,包括不需要属性,生产的xml属性会变成一个单独的节点
xmlCutil:insertOneNode('students.class', 'help_name','name_value',itIn);
print(xmlCutil:toString());


-- 插入一些属性值的值,创建新的节点
xmlCutil:insertNoProp('students.class', 'insert_name', helpXmlTest);
print(xmlCutil:toString());
-- sLayer 为空,则代表整个树,返回的help为 name,id,parent_id,value,prop(这个是一个子help,0x05,0x06分隔)
local helpTree = CSelectHelp();
xmlCutil:getTree('students.class', helpTree);
helpTree:dump();
Copyright © TouchNet 2015 all right reserved,powered by Gitbook最后修订时间: 2022-06-21 09:21:04

results matching ""

    No results matching ""