diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
commit | cca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch) | |
tree | 146f39ded1c938019e1ed42d30923c2ac9e86789 /src/xml/attribute-record.h | |
parent | Initial commit. (diff) | |
download | inkscape-upstream.tar.xz inkscape-upstream.zip |
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/xml/attribute-record.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/xml/attribute-record.h b/src/xml/attribute-record.h new file mode 100644 index 0000000..233016c --- /dev/null +++ b/src/xml/attribute-record.h @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/** @file + * TODO: insert short description here + *//* + * Authors: see git history + * + * Copyright (C) 2017 Authors + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ +/** @file + * @brief Key-value pair representing an attribute + */ + +#ifndef SEEN_XML_SP_REPR_ATTR_H +#define SEEN_XML_SP_REPR_ATTR_H + +#include <glib.h> +#include "inkgc/gc-managed.h" +#include "util/share.h" + +#define SP_REPR_ATTRIBUTE_KEY(a) g_quark_to_string((a)->key) +#define SP_REPR_ATTRIBUTE_VALUE(a) ((a)->value) + +namespace Inkscape { +namespace XML { + +/** + * @brief Key-value pair representing an attribute + * + * Internally, the attributes of each node in the XML tree are + * represented by this structure. + */ +class AttributeRecord : public Inkscape::GC::Managed<> { + public: + + AttributeRecord(GQuark k, Inkscape::Util::ptr_shared v) + : key(k), value(v) {} + + /** @brief GQuark corresponding to the name of the attribute */ + GQuark key; + /** @brief Shared pointer to the value of the attribute */ + Inkscape::Util::ptr_shared value; + bool operator== (const AttributeRecord &o) const {return key==o.key && value==o.value;} + + // accept default copy constructor and assignment operator +}; + +} +} + +#endif /* !SEEN_XML_SP_REPR_ATTR_H */ + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : |