Show
Ignore:
Timestamp:
10/08/08 09:00:07 (3 months ago)
Author:
tokuhirom
Message:

added attr.* methods

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/cplusplus/llv8call/trunk/ext/libxml/attr.cc

    r20881 r20947  
    2121// THE SOFTWARE. 
    2222 
    23 #include "libxml.h" 
     23#include "node.h" 
    2424 
    2525#define EXTERNAL_ATTR()   EXTERNAL(xmlAttrPtr, attr, args.This(),         0) 
    2626 
    27 FUNCTION(_new) 
     27FUNCTION(setValue) 
    2828    ARG_COUNT(1); 
    29     assert(args[0]->IsExternal()); 
    30     args.This()->SetInternalField(0, args[0]); 
    31     return args.This(); 
     29    ARG_str(val, 0); 
     30    EXTERNAL_NODE(); 
     31    domSetNodeValue(node, (xmlChar*)*val); 
     32    return Undefined(); 
    3233END 
    3334 
    3435SUBMODULE(init_attr) 
    3536    CLASS_WITH_CONSTRUCTOR(_new); 
    36     INTERNALCOUNT(1); 
     37    setupNodeIM(OBJECT_TEMPLATE); 
     38    BIND_IM("getValue",            getValue); 
     39    BIND_IM("value",               getValue); 
     40    BIND_IM("setValue",            setValue); 
     41    BIND_IM("getOwnerElement",     parentNode); 
    3742    EXPORT_CLASS("Attr"); 
    3843ENDSUBMODULE 
    3944 
    40 // REST: 0/8 
    41 // TODO: node.new 
    42 // TODO: node.getValue 
    43 // TODO: node.value 
    44 // TODO: node.setValue 
    45 // TODO: node.getOwnerElement 
    46 // TODO: node.setNamespace 
    47 // TODO: node.isId 
    48 // TODO: node.serializeContent($docencoding) 
     45// REST: 5/8 
     46// TODO: attr.setNamespace 
     47// TODO: attr.isId 
     48// TODO: attr.serializeContent($docencoding) 
     49