1 /** @file
2 * @brief Key-value pair representing an attribute
3 */
5 #ifndef SEEN_XML_SP_REPR_ATTR_H
6 #define SEEN_XML_SP_REPR_ATTR_H
8 #include <glib/gquark.h>
9 #include <glib/gtypes.h>
10 #include "gc-managed.h"
11 #include "util/share.h"
13 #define SP_REPR_ATTRIBUTE_KEY(a) g_quark_to_string((a)->key)
14 #define SP_REPR_ATTRIBUTE_VALUE(a) ((a)->value)
16 namespace Inkscape {
17 namespace XML {
19 /**
20 * @brief Key-value pair representing an attribute
21 *
22 * Internally, the attributes of each node in the XML tree are
23 * represented by this structure.
24 */
25 struct AttributeRecord : public Inkscape::GC::Managed<> {
26 AttributeRecord(GQuark k, Inkscape::Util::ptr_shared<char> v)
27 : key(k), value(v) {}
29 /** @brief GQuark corresponding to the name of the attribute */
30 GQuark key;
31 /** @brief Shared pointer to the value of the attribute */
32 Inkscape::Util::ptr_shared<char> value;
34 // accept default copy constructor and assignment operator
35 };
37 }
38 }
40 #endif /* !SEEN_XML_SP_REPR_ATTR_H */
42 /*
43 Local Variables:
44 mode:c++
45 c-file-style:"stroustrup"
46 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
47 indent-tabs-mode:nil
48 fill-column:99
49 End:
50 */
51 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :