1 #ifndef IMAGE_IO_XML_XML_ATTRIBUTE_RULE_H_ // NOLINT 2 #define IMAGE_IO_XML_XML_ATTRIBUTE_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 XmlAttributeRule parses the following syntax: 10 /// S? Name S? = S? 'Value' 11 /// S? Name S? = S? "Value" 12 class XmlAttributeRule : public XmlRule { 13 public: 14 XmlAttributeRule(); 15 16 private: 17 /// Builds an XmlTokenContext from the XmlActionContext and calls the 18 /// handler's AttributeName() function. 19 /// @param context The action context from the name terminal. 20 /// @return The result value from the handler's function. 21 DataMatchResult HandleName(const XmlActionContext& context); 22 23 /// Builds an XmlTokenContext from the XmlActionContext and calls the 24 /// handler's AttributeValue() function. 25 /// @param context The action context from the quoted string terminal. 26 /// @return The result value from the handler's function. 27 DataMatchResult HandleValue(const XmlActionContext& context); 28 }; 29 30 } // namespace image_io 31 } // namespace photos_editing_formats 32 33 #endif // IMAGE_IO_XML_XML_ATTRIBUTE_RULE_H_ // NOLINT 34