Exemple #1
0
void GText::resetStyle(STYLE newStyle) {
    _style = newStyle;
    _default();
    if (flagSetted(TITLE)) {
        title();
    } else if (flagSetted(SUBTITLE)) {
        subtitle();
    } else {
        flagSetted(SELECTED) ? select() : unselect();
        flagSetted(VALIDATED) ? validate() : unvalidate();
    }
}
Exemple #2
0
void expr_visitor::visit(expr_binop const* a) {
  if (expr_binop_callback != nullptr)
    expr_binop_callback(a);
  else
    _default(a);
}
void nonNegative(long value, const std::string& caller, const std::string& valueName, const std::string& details) {
    _spl_assert(value >= 0, caller, _default(valueName, "value"), _default(details, " must be non-negative but was " + std::to_string(value)));
}
void nonEmpty(const std::string& str, const std::string& caller, const std::string& valueName, const std::string& details) {
    _spl_assert(!str.empty(), caller, _default(valueName, "string"), _default(details, " must not be empty"));
}
void inRange2D(int x, int y, int minX, int minY, int maxX, int maxY, const std::string& caller, const std::string& xValueName, const std::string& yValueName, const std::string& details) {
    inRange(x, minX, maxX, caller, xValueName, _default(details, " must be between (" + std::to_string(minX) + "," + std::to_string(minY) + ")-" + std::to_string(maxX) + "," + std::to_string(maxY) + ") inclusive but was (" + std::to_string(x) + "," + std::to_string(y) + ")"));
    inRange(y, minY, maxY, caller, yValueName, _default(details, " must be between (" + std::to_string(minX) + "," + std::to_string(minY) + ")-" + std::to_string(maxX) + "," + std::to_string(maxY) + ") inclusive but was (" + std::to_string(x) + "," + std::to_string(y) + ")"));
}
void inRange(int value, int min, int max, const std::string& caller, const std::string& valueName, const std::string& details) {
    _spl_assert(min <= value && value <= max, caller, _default(valueName, "value"), _default(details, " must be between " + std::to_string(min) + " and " + std::to_string(max) + " inclusive but was " + std::to_string(value)));
}
void positive(int value, const std::string& caller, const std::string& valueName, const std::string& details) {
    _spl_assert(value > 0, caller, _default(valueName, "value"), _default(details, " must be positive but was " + std::to_string(value)));
}
void nonNull(const void* ptr, const std::string& caller, const std::string& valueName, const std::string& details) {
    _spl_assert(ptr != nullptr, caller, _default(valueName, "value"), _default(details, " must be non-null"));
}