diff --git a/Lua/lib/pugilua.dll b/Lua/lib/pugilua.dll index 9825aea..b6b996a 100644 Binary files a/Lua/lib/pugilua.dll and b/Lua/lib/pugilua.dll differ diff --git a/Lua/lib/pugilua.lib b/Lua/lib/pugilua.lib index f75705c..adc67aa 100644 Binary files a/Lua/lib/pugilua.lib and b/Lua/lib/pugilua.lib differ diff --git a/contrib/pugilua/pugilua_lib.cpp b/contrib/pugilua/pugilua_lib.cpp index f919057..c3b8bd9 100644 --- a/contrib/pugilua/pugilua_lib.cpp +++ b/contrib/pugilua/pugilua_lib.cpp @@ -123,16 +123,26 @@ namespace pugi { RefCountedPtr insert_attribute_after(const char* name, RefCountedPtr attr); RefCountedPtr insert_attribute_before(const char* name, RefCountedPtr attr); - RefCountedPtr append_copy(RefCountedPtr proto); - RefCountedPtr prepend_copy(RefCountedPtr proto); - RefCountedPtr insert_copy_after(RefCountedPtr proto, RefCountedPtr attr); - RefCountedPtr insert_copy_before(RefCountedPtr proto, RefCountedPtr attr); + RefCountedPtr append_attribute_copy(RefCountedPtr proto); + RefCountedPtr prepend_attribute_copy(RefCountedPtr proto); + RefCountedPtr insert_attribute_copy_after(RefCountedPtr proto, RefCountedPtr attr); + RefCountedPtr insert_attribute_copy_before(RefCountedPtr proto, RefCountedPtr attr); RefCountedPtr append(int type); RefCountedPtr prepend(int type); RefCountedPtr insert_after(int type, RefCountedPtr _node); RefCountedPtr insert_before(int type, RefCountedPtr _node); + RefCountedPtr append_child(const char* name); + RefCountedPtr prepend_child(const char* name); + RefCountedPtr insert_child_after(const char* name, RefCountedPtr _node); + RefCountedPtr insert_child_before(const char* name, RefCountedPtr _node); + + RefCountedPtr append_copy(RefCountedPtr proto); + RefCountedPtr prepend_copy(RefCountedPtr proto); + RefCountedPtr insert_copy_after(RefCountedPtr proto, RefCountedPtr _node); + RefCountedPtr insert_copy_before(RefCountedPtr proto, RefCountedPtr _node); + //todo: text() public: // non-lua interface @@ -327,19 +337,19 @@ namespace pugi { return RefCountedPtr(new lxml_attribute(node.insert_attribute_before(name,attr->get()))); } - RefCountedPtr lxml_node::append_copy(RefCountedPtr proto) { + RefCountedPtr lxml_node::append_attribute_copy(RefCountedPtr proto) { return RefCountedPtr(new lxml_attribute(node.append_copy(proto->get()))); } - RefCountedPtr lxml_node::prepend_copy(RefCountedPtr proto) { + RefCountedPtr lxml_node::prepend_attribute_copy(RefCountedPtr proto) { return RefCountedPtr(new lxml_attribute(node.prepend_copy(proto->get()))); } - RefCountedPtr lxml_node::insert_copy_after(RefCountedPtr proto, RefCountedPtr attr) { + RefCountedPtr lxml_node::insert_attribute_copy_after(RefCountedPtr proto, RefCountedPtr attr) { return RefCountedPtr(new lxml_attribute(node.insert_copy_after(proto->get(),attr->get()))); } - RefCountedPtr lxml_node::insert_copy_before(RefCountedPtr proto, RefCountedPtr attr) { + RefCountedPtr lxml_node::insert_attribute_copy_before(RefCountedPtr proto, RefCountedPtr attr) { return RefCountedPtr(new lxml_attribute(node.insert_copy_before(proto->get(),attr->get()))); } @@ -359,6 +369,38 @@ namespace pugi { return RefCountedPtr(new lxml_node(node.insert_child_before((xml_node_type)type,_node->get()))); } + RefCountedPtr lxml_node::append_child(const char* name) { + return RefCountedPtr(new lxml_node(node.append_child(name))); + } + + RefCountedPtr lxml_node::prepend_child(const char* name) { + return RefCountedPtr(new lxml_node(node.prepend_child(name))); + } + + RefCountedPtr lxml_node::insert_child_after(const char* name, RefCountedPtr _node) { + return RefCountedPtr(new lxml_node(node.insert_child_after(name,_node->get()))); + } + + RefCountedPtr lxml_node::insert_child_before(const char* name, RefCountedPtr _node) { + return RefCountedPtr(new lxml_node(node.insert_child_before(name,_node->get()))); + } + + RefCountedPtr lxml_node::append_copy(RefCountedPtr proto) { + return RefCountedPtr(new lxml_node(node.append_copy(proto->get()))); + } + + RefCountedPtr lxml_node::prepend_copy(RefCountedPtr proto) { + return RefCountedPtr(new lxml_node(node.prepend_copy(proto->get()))); + } + + RefCountedPtr lxml_node::insert_copy_after(RefCountedPtr proto, RefCountedPtr _node) { + return RefCountedPtr(new lxml_node(node.insert_copy_after(proto->get(),_node->get()))); + } + + RefCountedPtr lxml_node::insert_copy_before(RefCountedPtr proto, RefCountedPtr _node) { + return RefCountedPtr(new lxml_node(node.insert_copy_before(proto->get(),_node->get()))); + } + /////////////////// RefCountedPtr lxml_document::load_file(char const* path) { return RefCountedPtr(new lxml_parse_result(doc.load_file(path))); @@ -467,14 +509,22 @@ void register_pugilua (lua_State* L) { .addFunction("prepend_attribute",&lxml_node::prepend_attribute) .addFunction("insert_attribute_after",&lxml_node::insert_attribute_after) .addFunction("insert_attribute_before",&lxml_node::insert_attribute_before) - .addFunction("append_copy",&lxml_node::append_copy) - .addFunction("prepend_copy",&lxml_node::prepend_copy) - .addFunction("insert_copy_after",&lxml_node::insert_copy_after) - .addFunction("insert_copy_before",&lxml_node::insert_copy_before) + .addFunction("append_attribute_copy",&lxml_node::append_attribute_copy) + .addFunction("prepend_attribute_copy",&lxml_node::prepend_attribute_copy) + .addFunction("insert_attribute_copy_after",&lxml_node::insert_attribute_copy_after) + .addFunction("insert_attribute_copy_before",&lxml_node::insert_attribute_copy_before) .addFunction("append",&lxml_node::append) .addFunction("prepend",&lxml_node::prepend) .addFunction("insert_after",&lxml_node::insert_after) .addFunction("insert_before",&lxml_node::insert_before) + .addFunction("append_child",&lxml_node::append_child) + .addFunction("prepend_child",&lxml_node::prepend_child) + .addFunction("insert_child_after",&lxml_node::insert_child_after) + .addFunction("insert_child_before",&lxml_node::insert_child_before) + .addFunction("append_copy",&lxml_node::append_copy) + .addFunction("prepend_copy",&lxml_node::prepend_copy) + .addFunction("insert_copy_after",&lxml_node::insert_copy_after) + .addFunction("insert_copy_before",&lxml_node::insert_copy_before) .endClass() .beginClass("xml_document")