10bool ExprSpecParse(std::vector<Editable *> &literals, std::vector<std::string> &variables, std::vector<std::pair<int, int>> &comments,
const char *str);
24 std::vector<std::pair<int, int>> comments;
29 int endPos = literal.
endPos;
31 for (
auto &ci : comments) {
32 if (ci.first >= endPos) {
34 size_t pos =
_expr.find(
'\n', endPos);
35 if (pos == std::string::npos || pos >= (
size_t)ci.second) {
36 comment =
_expr.substr(ci.first, ci.second - ci.first);
62 std::stringstream stream;
69 stream <<
_expr.substr(offset,
_expr.size() - offset);
79 for (
size_t i = 0, sz =
_editables.size(); i < sz; i++) {
92 for (
size_t i = 0, sz =
_editables.size(); i < sz; i++) {
bool ExprSpecParse(std::vector< Editable * > &literals, std::vector< std::string > &variables, std::vector< std::pair< int, int > > &comments, const char *str)
Factors a SeExpr into an editable expression with controls (i.e. value boxes, curve boxes)
std::vector< std::string > _variables
void setExpr(const std::string &expr)
Set's expressions and parses it into "control editable form".
std::string getEditedExpr() const
Return a reconstructed expression using all the editable's current values.
virtual ~EditableExpression()
bool controlsMatch(const EditableExpression &other) const
Check if the other editable expression has editables that all match i.e. the controls are same.
void cleanup()
clean memeory
void updateString(const EditableExpression &other)
Update the string refered to into the controls (this is only valid if controlsmatch)
void updatePositions(const Editable &other)
virtual void appendString(std::stringstream &stream) const =0
virtual bool parseComment(const std::string &comment)=0
parses a comment. if false is returned then delete the control from the editable
virtual bool controlsMatch(const Editable &) const =0