The Value class represents a Scratch value.
More...
#include <scratchcpp/value.h>
|
| bool | operator== (const Value &v1, const Value &v2) |
| |
| bool | operator!= (const Value &v1, const Value &v2) |
| |
| bool | operator> (const Value &v1, const Value &v2) |
| |
| bool | operator< (const Value &v1, const Value &v2) |
| |
| bool | operator>= (const Value &v1, const Value &v2) |
| |
| bool | operator<= (const Value &v1, const Value &v2) |
| |
| Value | operator+ (const Value &v1, const Value &v2) |
| |
| Value | operator- (const Value &v1, const Value &v2) |
| |
| Value | operator* (const Value &v1, const Value &v2) |
| |
| Value | operator/ (const Value &v1, const Value &v2) |
| |
| Value | operator% (const Value &v1, const Value &v2) |
| |
The Value class represents a Scratch value.
◆ Value() [1/8]
| libscratchcpp::Value::Value |
( |
double | numberValue = 0.0 | ) |
|
|
inline |
Constructs a number Value.
◆ Value() [2/8]
template<typename T, typename = std::enable_if_t<std::is_integral<T>::value>>
| libscratchcpp::Value::Value |
( |
T | numberValue | ) |
|
|
inline |
Constructs a number Value.
◆ Value() [3/8]
| libscratchcpp::Value::Value |
( |
bool | boolValue | ) |
|
|
inline |
Constructs a boolean Value.
◆ Value() [4/8]
| libscratchcpp::Value::Value |
( |
const std::string & | stringValue | ) |
|
|
inline |
Constructs a string Value.
◆ Value() [5/8]
| libscratchcpp::Value::Value |
( |
const char * | stringValue | ) |
|
|
inline |
Constructs a string Value.
◆ Value() [6/8]
| libscratchcpp::Value::Value |
( |
const void * | pointerValue | ) |
|
|
inline |
Constructs a pointer Value.
◆ Value() [7/8]
| libscratchcpp::Value::Value |
( |
const ValueData & | v | ) |
|
|
inline |
◆ Value() [8/8]
| libscratchcpp::Value::Value |
( |
const Value & | v | ) |
|
|
inline |
◆ ~Value()
| libscratchcpp::Value::~Value |
( |
| ) |
|
|
inline |
◆ add()
| void libscratchcpp::Value::add |
( |
const Value & | v | ) |
|
|
inline |
Adds the given value to the value.
◆ data() [1/2]
Returns a read/write reference to the data.
- Note
- Valid until the Value object is destroyed.
◆ data() [2/2]
| const ValueData & libscratchcpp::Value::data |
( |
| ) |
const |
|
inline |
Returns a read-only reference to the data.
- Note
- Valid until the Value object is destroyed.
◆ divide()
| void libscratchcpp::Value::divide |
( |
const Value & | v | ) |
|
|
inline |
Divides the value by the given value.
◆ isBool()
| bool libscratchcpp::Value::isBool |
( |
| ) |
const |
|
inline |
Returns true if the value is a boolean.
◆ isInfinity()
| bool libscratchcpp::Value::isInfinity |
( |
| ) |
const |
|
inline |
Returns true if the value is infinity.
◆ isInt()
| bool libscratchcpp::Value::isInt |
( |
| ) |
const |
|
inline |
Returns true if this value represents a round integer.
◆ isNaN()
| bool libscratchcpp::Value::isNaN |
( |
| ) |
const |
|
inline |
Returns true if the value is NaN (Not a Number).
◆ isNegativeInfinity()
| bool libscratchcpp::Value::isNegativeInfinity |
( |
| ) |
const |
|
inline |
Returns true if the value is negative infinity.
◆ isNumber()
| bool libscratchcpp::Value::isNumber |
( |
| ) |
const |
|
inline |
Returns true if the value is a number.
◆ isPointer()
| bool libscratchcpp::Value::isPointer |
( |
| ) |
const |
|
inline |
Returns true if the value is a pointer.
◆ isString()
| bool libscratchcpp::Value::isString |
( |
| ) |
const |
|
inline |
Returns true if the value is a string.
◆ isValidNumber()
| bool libscratchcpp::Value::isValidNumber |
( |
| ) |
const |
|
inline |
Returns true if the value is a number or can be converted to a number.
◆ mod()
| void libscratchcpp::Value::mod |
( |
const Value & | v | ) |
|
|
inline |
Replaces the value with modulo of the value and the given value.
◆ multiply()
| void libscratchcpp::Value::multiply |
( |
const Value & | v | ) |
|
|
inline |
Multiplies the given value with the value.
◆ operator=() [1/8]
| const Value & libscratchcpp::Value::operator= |
( |
bool | v | ) |
|
|
inline |
◆ operator=() [2/8]
| const Value & libscratchcpp::Value::operator= |
( |
const char * | v | ) |
|
|
inline |
◆ operator=() [3/8]
| const Value & libscratchcpp::Value::operator= |
( |
const std::string & | v | ) |
|
|
inline |
◆ operator=() [4/8]
| const Value & libscratchcpp::Value::operator= |
( |
const Value & | v | ) |
|
|
inline |
◆ operator=() [5/8]
◆ operator=() [6/8]
| const Value & libscratchcpp::Value::operator= |
( |
const void * | v | ) |
|
|
inline |
◆ operator=() [7/8]
| const Value & libscratchcpp::Value::operator= |
( |
double | v | ) |
|
|
inline |
◆ operator=() [8/8]
template<typename T, typename = std::enable_if_t<std::is_integral<T>::value>>
| const Value & libscratchcpp::Value::operator= |
( |
T | v | ) |
|
|
inline |
◆ subtract()
| void libscratchcpp::Value::subtract |
( |
const Value & | v | ) |
|
|
inline |
Subtracts the given value from the value.
◆ toBool()
| bool libscratchcpp::Value::toBool |
( |
| ) |
const |
|
inline |
Returns the boolean representation of the value.
◆ toDouble()
| double libscratchcpp::Value::toDouble |
( |
| ) |
const |
|
inline |
Returns the double representation of the value.
◆ toInt()
| int libscratchcpp::Value::toInt |
( |
| ) |
const |
|
inline |
Returns the int representation of the value.
◆ toLong()
| long libscratchcpp::Value::toLong |
( |
| ) |
const |
|
inline |
Returns the long representation of the value.
◆ toPointer()
| const void * libscratchcpp::Value::toPointer |
( |
| ) |
const |
|
inline |
Returns the pointer stored in the value or nullptr if it isn't a pointer.
◆ toRgba()
| Rgb libscratchcpp::Value::toRgba |
( |
| ) |
const |
|
inline |
Converts the value to an RGBA quadruplet.
◆ toString()
| std::string libscratchcpp::Value::toString |
( |
| ) |
const |
|
inline |
Returns the string representation of the value.
◆ toUtf16()
| std::u16string libscratchcpp::Value::toUtf16 |
( |
| ) |
const |
|
inline |
Returns the UTF-16 representation of the value.
◆ type()
| ValueType libscratchcpp::Value::type |
( |
| ) |
const |
|
inline |
Returns the type of the value.
◆ operator!=
| bool operator!= |
( |
const Value & | v1, |
|
|
const Value & | v2 ) |
|
friend |
◆ operator%
◆ operator*
◆ operator+
◆ operator-
◆ operator/
◆ operator<
| bool operator< |
( |
const Value & | v1, |
|
|
const Value & | v2 ) |
|
friend |
◆ operator<=
| bool operator<= |
( |
const Value & | v1, |
|
|
const Value & | v2 ) |
|
friend |
◆ operator==
| bool operator== |
( |
const Value & | v1, |
|
|
const Value & | v2 ) |
|
friend |
◆ operator>
| bool operator> |
( |
const Value & | v1, |
|
|
const Value & | v2 ) |
|
friend |
◆ operator>=
| bool operator>= |
( |
const Value & | v1, |
|
|
const Value & | v2 ) |
|
friend |
The documentation for this class was generated from the following file: