#include <relative_point.hpp>
Public Member Functions | |
| float | evaluate (const Rect &parent, const std::map< std::string, Rect > &named={}) const |
| Evaluate this expression against the given parent rectangle and optional environment of named rectangles. | |
| std::string | to_string () const |
| Round-trip text form for diagnostics. | |
Static Public Member Functions | |
| static float | evaluate (const std::string &source, const Rect &parent, const std::map< std::string, Rect > &named={}) |
| Convenience: parse + evaluate in one shot. Throws on parse error. | |
| static RelativeExpression | parse (const std::string &source) |
| Parse a single-axis expression (e.g. | |
| float pulp::view::RelativeExpression::evaluate | ( | const Rect & | parent, |
| const std::map< std::string, Rect > & | named = {} ) const |
Evaluate this expression against the given parent rectangle and optional environment of named rectangles.
Throws std::runtime_error if a qualified name refers to a missing rectangle.
|
static |
Convenience: parse + evaluate in one shot. Throws on parse error.
|
static |
Parse a single-axis expression (e.g.
"right - 10"). Throws std::invalid_argument on syntax error with a position-bearing message.
| std::string pulp::view::RelativeExpression::to_string | ( | ) | const |
Round-trip text form for diagnostics.
Re-parses to the same tree (numbers may be reformatted).