1 #ifndef IMAGE_IO_XML_XML_PI_RULE_H_ // NOLINT 2 #define IMAGE_IO_XML_XML_PI_RULE_H_ // NOLINT 3 4 #include "image_io/xml/xml_rule.h" 5 6 namespace photos_editing_formats { 7 namespace image_io { 8 9 /// The XmlPiRule parses the processing information syntax: "<?...?>". This 10 /// syntax is considerably simplified from the official XML specification. As 11 /// documented in the comments for the XmlHandler Pi() function, The leading 12 /// "<?" syntax is never sent to the handler, while the trailing "?>" literal 13 /// is always sent as part of the processing content token. This approach makes 14 /// it much easier to parse XML syntax. The alternate start point constructor 15 /// is used by the XmlElementContentRule. 16 class XmlPiRule : public XmlRule { 17 public: 18 XmlPiRule(); 19 explicit XmlPiRule(StartPoint start_point); 20 21 private: 22 /// Builds an XmlTokenContext from the XmlActionContext and calls the 23 /// handler's Pi() function. 24 /// @param context The action context from the rule's terminal. 25 /// @return The result value from the handler's function. 26 DataMatchResult HandlePiValue(const XmlActionContext& context); 27 }; 28 29 } // namespace image_io 30 } // namespace photos_editing_formats 31 32 #endif // IMAGE_IO_XML_XML_PI_RULE_H_ // NOLINT 33