PropertyParserTransform.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "../../Include/RmlUi/Core/PropertyParser.h"
  3. #include "PropertyParserNumber.h"
  4. namespace Rml {
  5. /**
  6. A property parser that parses a RCSS transform property specification.
  7. */
  8. class PropertyParserTransform : public PropertyParser {
  9. public:
  10. PropertyParserTransform();
  11. virtual ~PropertyParserTransform();
  12. /// Called to parse a RCSS transform declaration.
  13. /// @param[out] property The property to set the parsed value on.
  14. /// @param[in] value The raw value defined for this property.
  15. /// @param[in] parameters The parameters defined for this property.
  16. /// @return True if the value was validated successfully, false otherwise.
  17. bool ParseValue(Property& property, const String& value, const ParameterMap& parameters) const override;
  18. private:
  19. /// Scan a string for a parameterized keyword with a certain number of numeric arguments.
  20. /// @param[out] out_bytes_read The number of bytes read if the keyword occurs at the beginning of str, 0 otherwise.
  21. /// @param[in] str The string to search for the parameterized keyword
  22. /// @param[in] keyword The name of the keyword to search for
  23. /// @param[in] parsers The numeric argument parsers
  24. /// @param[out] args The numeric arguments encountered
  25. /// @param[in] nargs The number of numeric arguments expected
  26. /// @return True if parsed successfully, false otherwise.
  27. bool Scan(int& out_bytes_read, const char* str, const char* keyword, const PropertyParser** parsers, NumericValue* args, int nargs) const;
  28. PropertyParserNumber number, length, length_pct, angle;
  29. };
  30. } // namespace Rml