diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2018-11-15 16:07:46 -0800 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2018-11-15 16:07:46 -0800 |
commit | 2d6d3250dcb304c8ad081dedc8eef6ea48fd669d (patch) | |
tree | 68cc8d5a9bf5a558f46025d740c47cb292eea9f0 /includes/image_io/xml/xml_pi_rule.h | |
parent | 840fc3b66a9e6593d542ada6fe14d91107fab98d (diff) | |
download | image_io-2d6d3250dcb304c8ad081dedc8eef6ea48fd669d.tar.gz |
Initial commit of libimage_io
Image_io is a library for manipulating image files, especially XMP
metadata within them.
Test: m libimage_io
Bug: 109735087
Bug: 119211681
Change-Id: I657f307be0459fe40154806c7cd388b97bcb0ea5
Diffstat (limited to 'includes/image_io/xml/xml_pi_rule.h')
-rw-r--r-- | includes/image_io/xml/xml_pi_rule.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/includes/image_io/xml/xml_pi_rule.h b/includes/image_io/xml/xml_pi_rule.h new file mode 100644 index 0000000..674a3fa --- /dev/null +++ b/includes/image_io/xml/xml_pi_rule.h @@ -0,0 +1,32 @@ +#ifndef IMAGE_IO_XML_XML_PI_RULE_H_ // NOLINT +#define IMAGE_IO_XML_XML_PI_RULE_H_ // NOLINT + +#include "image_io/xml/xml_rule.h" + +namespace photos_editing_formats { +namespace image_io { + +/// The XmlPiRule parses the processing information syntax: "<?...?>". This +/// syntax is considerably simplified from the official XML specification. As +/// documented in the comments for the XmlHandler Pi() function, The leading +/// "<?" syntax is never sent to the handler, while the trailing "?>" literal +/// is always sent as part of the processing content token. This approach makes +/// it much easier to parse XML syntax. The alternate start point constructor +/// is used by the XmlElementContentRule. +class XmlPiRule : public XmlRule { + public: + XmlPiRule(); + explicit XmlPiRule(StartPoint start_point); + + private: + /// Builds an XmlTokenContext from the XmlActionContext and calls the + /// handler's Pi() function. + /// @param context The action context from the rule's terminal. + /// @return The result value from the handler's function. + DataMatchResult HandlePiValue(const XmlActionContext& context); +}; + +} // namespace image_io +} // namespace photos_editing_formats + +#endif // IMAGE_IO_XML_XML_PI_RULE_H_ // NOLINT |