Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

gchar const * Inkscape::XML::SimpleNode::attribute ( gchar const *  key  )  const [virtual, inherited]

Get the string representation of a node's attribute.

If there is no attribute with the given name, the method will return NULL. All strings returned by this method are owned by the node and may not be freed. The returned pointer will become invalid when the attribute changes. If you need to store the return value, use g_strdup(). To parse the string, use methods in repr.h

key The name of the node's attribute

Implements Inkscape::XML::Node.

Definition at line 222 of file simple-node.cpp.

    g_return_val_if_fail(name != NULL, NULL);

    GQuark const key = g_quark_from_string(name);

    for ( List<AttributeRecord const> iter = _attributes ;
          iter ; ++iter )
        if ( iter->key == key ) {
            return iter->value;

    return NULL;

Generated by  Doxygen 1.6.0   Back to index