/// \brief Contruct a Property from a Boolean /// /// @param name The name of the Property /// /// @param data The boolean to use as the value of the property. Element::Element(const string &name, bool indata) : _name(nullptr), _type(NOTYPE) { // GNASH_REPORT_FUNCTION; makeBoolean(name, indata); }
/// \brief Contruct an AMF Element from a Boolean /// /// @param data The boolean to use as the value for this Element. Element::Element(bool data) : _name(nullptr), _type(NOTYPE) { // GNASH_REPORT_FUNCTION; makeBoolean(data); }
/// \brief Make this Element with a boolean value. /// The size isn't needed as a boolean is always the same size. /// /// @param data A real pointer to the boolean use as the value. /// /// @return A reference to this Element. Element & Element::makeBoolean(std::uint8_t *data) { // GNASH_REPORT_FUNCTION; bool flag = *reinterpret_cast<const bool*>(data); return makeBoolean(flag); }
/// \brief Make this Element a Property with a boolean value /// /// @param name The name of the Property /// /// @param data The boolean to use as the value of the property. /// /// @return A reference to this Element. Element & Element::makeBoolean(const string &name, bool flag) { // GNASH_REPORT_FUNCTION; if (name.size()) { setName(name); } return makeBoolean(flag); }
void isCompoundProcedure(Register result, Register procedure) { makeBoolean(result, isTaggedList(procedure, "procedure")); }
void isLastOperand(Register result, Register ops) { cdr(result, ops); makeBoolean(result, isNull(result)); }
void isQuoted(Register result, Register exp) { makeBoolean(result, isTaggedList(exp, "quote")); }
void isNoOperands(Register result, Register ops) { makeBoolean(result, isNull(ops)); }
void isApplication(Register result, Register exp) { makeBoolean(result, isPair(exp)); }
void isLastExp(Register result, Register exp) { cdr(result, exp); makeBoolean(result, isNull(result)); }
void isVariable(Register result, Register exp) { makeBoolean(result, isSymbol(exp)); }
void isIf(Register result, Register exp) { makeBoolean(result, isTaggedList(exp, "if")); }
void isLambda(Register result, Register exp) { makeBoolean(result, isTaggedList(exp, "lambda")); }
void isSelfEvaluating(Register result, Register exp) { makeBoolean(result, (isNumber(exp) || isString(exp))); }
/// \brief Make this Element be the same as a boolean value. /// This sets both the data type and the value. /// /// @param el A boolean value. /// /// @return A reference to this Element. Element & Element::operator=(bool flag) { return makeBoolean(flag); }
void isAssignment(Register result, Register exp) { makeBoolean(result, isTaggedList(exp, "set!")); }
void isDefinition(Register result, Register exp) { makeBoolean(result, isTaggedList(exp, "define")); }
void isBegin(Register result, Register exp) { makeBoolean(result, isTaggedList(exp, "begin")); }