diff options
Diffstat (limited to 'internal/dynamic_depth/element.h')
-rw-r--r-- | internal/dynamic_depth/element.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/internal/dynamic_depth/element.h b/internal/dynamic_depth/element.h new file mode 100644 index 0000000..e68829d --- /dev/null +++ b/internal/dynamic_depth/element.h @@ -0,0 +1,34 @@ +#ifndef DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_ELEMENT_H_ // NOLINT +#define DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_ELEMENT_H_ // NOLINT + +#include <unordered_map> + +#include "xmpmeta/xml/deserializer.h" +#include "xmpmeta/xml/serializer.h" + +namespace photos_editing_formats { +namespace dynamic_depth { + +/** + * An interface for an element in the Dynamic Depth spec. + */ +class Element { + public: + virtual ~Element() {} + + // Appends child elements' namespaces' and their respective hrefs to the + // given collection, and any parent nodes' names to prefix_names. + // Key: Name of the namespace. + // Value: Full namespace URL. + // Example: ("Image", "http://ns.google.com/photos/dd/1.0/image/") + virtual void GetNamespaces( + std::unordered_map<string, string>* ns_name_href_map) = 0; + + // Serializes this element. + virtual bool Serialize(xml::Serializer* serializer) const = 0; +}; + +} // namespace dynamic_depth +} // namespace photos_editing_formats + +#endif // DYNAMIC_DEPTH_INTERNAL_DYNAMIC_DEPTH_ELEMENT_H_ // NOLINT |