diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2018-11-15 15:49:02 -0800 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2018-11-15 16:07:24 -0800 |
commit | 09f199a694ef5b956cabc368e40ab5ca11c64044 (patch) | |
tree | 456d184a3817c8b6524a90fc2da60893a2fc1895 /internal/xmpmeta/xml/search.h | |
parent | 2d25fc4f6a7e7453f877958a2f3f59b6cc588ca4 (diff) | |
download | dynamic_depth-09f199a694ef5b956cabc368e40ab5ca11c64044.tar.gz |
Initial commit of libdynamic_depth
Dynamic depth is a standard for embedding depth maps and
other similar extensions into standard image files like JPEG.
Test: m libdynamic_depth
Bug: 109735087
Bug: 119211681
Change-Id: I0103b7d47e60dc8e3a3b277456903d76f727926f
Diffstat (limited to 'internal/xmpmeta/xml/search.h')
-rw-r--r-- | internal/xmpmeta/xml/search.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/internal/xmpmeta/xml/search.h b/internal/xmpmeta/xml/search.h new file mode 100644 index 0000000..c420661 --- /dev/null +++ b/internal/xmpmeta/xml/search.h @@ -0,0 +1,36 @@ +#ifndef DYNAMIC_DEPTH_INTERNAL_XMPMETA_XML_SEARCH_H_ // NOLINT +#define DYNAMIC_DEPTH_INTERNAL_XMPMETA_XML_SEARCH_H_ // NOLINT + +#include <libxml/tree.h> + +// Performs searches an XML tree. +namespace photos_editing_formats { +namespace xml { + +// Depth-first search on the nodes in this XML doc. +// Performs Depth first search on the child XML elements in order. +// Returns the first child element with a matching node name. If not found, +// returns a null pointer. +xmlNodePtr DepthFirstSearch(const xmlDocPtr parent, const char* name); + +// Returns the first child element with a matching prefix and name. +// If prefix is null or empty, this has the same effect as the method abouve. +// Otherwise, the resulting node's namespace and its name must not be null. +xmlNodePtr DepthFirstSearch(const xmlDocPtr parent, const char* prefix, + const char* name); + +// Depth-first search on the parent, for a child element with the given name. +// The element name excludes its prefix. +// Returns a null pointer if no matching element is found. +xmlNodePtr DepthFirstSearch(const xmlNodePtr parent, const char* name); + +// Returns the first child element with a matching prefix and name. +// If prefix is null or empty, this has the same effect as the method abouve. +// Otherwise, the resulting node's namespace and its name must not be null. +xmlNodePtr DepthFirstSearch(const xmlNodePtr parent, const char* prefix, + const char* name); + +} // namespace xml +} // namespace photos_editing_formats + +#endif // DYNAMIC_DEPTH_INTERNAL_XMPMETA_XML_SEARCH_H_ // NOLINT |