Changeset 20828 for lang/cplusplus
- Timestamp:
- 10/06/08 09:21:47 (2 months ago)
- Location:
- lang/cplusplus/llv8call/trunk
- Files:
-
- 3 added
- 5 modified
-
ext/libxml/SConscript (modified) (1 diff)
-
ext/libxml/document.cc (modified) (5 diffs)
-
ext/libxml/dom.c (added)
-
ext/libxml/dom.h (added)
-
ext/libxml/libxml.cc (modified) (2 diffs)
-
ext/libxml/libxml.h (modified) (1 diff)
-
ext/libxml/node.cc (added)
-
t/070_libxml/01_simple.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/cplusplus/llv8call/trunk/ext/libxml/SConscript
r20827 r20828 12 12 env.SharedLibrary( 13 13 "libxml", 14 [Split('libxml.cc document.cc ')],14 [Split('libxml.cc document.cc node.cc dom.c')], 15 15 LIBS=['v8'] + env['LIBS'], 16 16 ) -
lang/cplusplus/llv8call/trunk/ext/libxml/document.cc
r20827 r20828 25 25 #define EXTERNAL_DOC() EXTERNAL(xmlDocPtr, doc, args.This(), 0); 26 26 27 FUNCTION(_ ReadFile)27 FUNCTION(_readFile) 28 28 ARG_COUNT(1); 29 29 ARG_str(fname, 0); … … 34 34 END 35 35 36 FUNCTION(_ Encoding)36 FUNCTION(_encoding) 37 37 ARG_COUNT(0); 38 38 EXTERNAL_DOC(); … … 40 40 END 41 41 42 FUNCTION(_ Version)42 FUNCTION(_version) 43 43 ARG_COUNT(0); 44 44 EXTERNAL_DOC(); … … 46 46 END 47 47 48 FUNCTION(_Close) 48 FUNCTION(_documentElement) 49 ARG_COUNT(0); 50 EXTERNAL_DOC(); 51 52 xmlNodePtr node_raw = xmlDocGetRootElement(doc); 53 assert(node_raw); 54 55 Handle<Value> consarg[1]; 56 consarg[0] = External::New(node_raw); 57 Handle<Object> node = node_class()->NewInstance(1, consarg); 58 return node; 59 END 60 61 FUNCTION(_close) 49 62 ARG_COUNT(0); 50 63 EXTERNAL_DOC(); … … 55 68 SUBMODULE(init_document) 56 69 CLASS(); 57 BIND_IM("ReadFile", _ReadFile); 58 BIND_IM("Encoding", _Encoding); 59 BIND_IM("Version", _Version); 60 BIND_IM("Close", _Close); 70 BIND_IM("readFile", _readFile); 71 BIND_IM("encoding", _encoding); 72 BIND_IM("version", _version); 73 BIND_IM("documentElement", _documentElement); 74 BIND_IM("close", _close); 61 75 INTERNALCOUNT(1); 62 76 EXPORT_CLASS("Document"); -
lang/cplusplus/llv8call/trunk/ext/libxml/libxml.cc
r20827 r20828 34 34 35 35 extern void init_document(Handle<Object> target); 36 extern void init_node(Handle<Object> target); 36 37 37 38 V8EXTINIT_FUNC … … 41 42 42 43 init_document(target); 44 init_node(target); 43 45 44 46 return target; -
lang/cplusplus/llv8call/trunk/ext/libxml/libxml.h
r20827 r20828 6 6 #include <libxml/parser.h> 7 7 #include <libxml/tree.h> 8 #include "dom.h" 8 9 #include "v8ext.h" 9 10 #include "llv8-macros.h" -
lang/cplusplus/llv8call/trunk/t/070_libxml/01_simple.js
r20827 r20828 6 6 var libxml = org.coderepos.libxml; 7 7 var doc = new libxml.Document(); 8 doc.ReadFile("t/070_libxml/simple.xml"); 9 is(doc.Encoding(), "UTF-8"); 10 is(doc.Version(), "1.0"); 11 doc.Close(); 8 doc.readFile("t/070_libxml/simple.xml"); 9 is(doc.encoding(), "UTF-8"); 10 is(doc.version(), "1.0"); 11 is(doc.documentElement().nodeName(), "foo"); 12 doc.close(); 12 13 13 14 ok(true);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)