Changeset 20850 for lang/cplusplus
- Timestamp:
- 10/06/08 21:25:12 (2 months ago)
- Location:
- lang/cplusplus/llv8call/trunk
- Files:
-
- 3 modified
-
ext/libxml/document.cc (modified) (4 diffs)
-
ext/libxml/node.cc (modified) (1 diff)
-
t/070_libxml/01_simple.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/cplusplus/llv8call/trunk/ext/libxml/document.cc
r20849 r20850 70 70 END 71 71 72 FUNCTION(toString) 73 ARG_BETWEEN(0, 1); 74 EXTERNAL_DOC(); 75 int format = args.Length() > 0 ? args[0]->Int32Value() : 0; 76 xmlChar * result = NULL; 77 int len = 0; 78 if (format <= 0) { 79 xmlDocDumpMemory(doc, &result, &len); 80 } else { 81 int t_indent_var = xmlIndentTreeOutput; 82 xmlIndentTreeOutput = 1; 83 xmlDocDumpFormatMemory(doc, &result, &len, format ); 84 xmlIndentTreeOutput = t_indent_var; 85 } 86 Handle<String> str = String::New((const char*)result, len); 87 xmlFree(result); 88 return str; 89 END 90 72 91 FUNCTION(_close) 73 92 ARG_COUNT(0); … … 84 103 BIND_IM("documentElement", _documentElement); 85 104 BIND_IM("createElement", _createElement); 105 BIND_IM("toString", toString); 86 106 BIND_IM("close", _close); 87 107 INTERNALCOUNT(1); 88 108 EXPORT_CLASS("Document"); 89 109 ENDSUBMODULE 110 111 // rest: 44/51 90 112 91 113 // TODO: doc.createDocument … … 96 118 // TODO: doc.compression 97 119 // TODO: doc.setCompression 98 // TODO: doc.toString99 120 // TODO: doc.toStringC14N 100 121 // TODO: doc.toStringEC14N … … 110 131 // TODO: doc.documentElement 111 132 // TODO: doc.setDocumentElement 112 // TODO: doc.createElement113 133 // TODO: doc.createElementNS 114 134 // TODO: doc.createTextNode -
lang/cplusplus/llv8call/trunk/ext/libxml/node.cc
r20849 r20850 45 45 ENDSUBMODULE 46 46 47 // REST: 49/50 47 48 // TODO: node.setNodeName 48 49 // TODO: node.isSameNode -
lang/cplusplus/llv8call/trunk/t/070_libxml/01_simple.js
r20849 r20850 11 11 is(doc.documentElement().nodeName(), "foo"); 12 12 is(doc.createElement("bar").nodeName(), "bar", 'createElement'); 13 is(doc.toString(), '<?xml version="1.0" encoding="UTF-8"?>' + "\n" + '<foo/>' + "\n", 'toString'); 13 14 doc.close(); 14 15
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)