Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::RelativeExpression Class Reference

#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.

Member Function Documentation

◆ evaluate() [1/2]

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.

◆ evaluate() [2/2]

float pulp::view::RelativeExpression::evaluate ( const std::string & source,
const Rect & parent,
const std::map< std::string, Rect > & named = {} )
static

Convenience: parse + evaluate in one shot. Throws on parse error.

◆ parse()

RelativeExpression pulp::view::RelativeExpression::parse ( const std::string & source)
static

Parse a single-axis expression (e.g.

"right - 10"). Throws std::invalid_argument on syntax error with a position-bearing message.

◆ to_string()

std::string pulp::view::RelativeExpression::to_string ( ) const

Round-trip text form for diagnostics.

Re-parses to the same tree (numbers may be reformatted).


The documentation for this class was generated from the following file: