libscratchcpp
A library for C++ based Scratch project players
Loading...
Searching...
No Matches
libscratchcpp Namespace Reference

The main namespace of the library. More...

Namespaces

namespace  test
 

Classes

class  Asset
 The Asset class represents a Scratch asset, for example a Costume or a Sound. More...
 
class  Block
 The Block class represents a Scratch block. More...
 
class  BlockPrototype
 The BlockPrototype class represents the prototype of a custom block. More...
 
class  Broadcast
 The Broadcast class represents a Scratch broadcast. More...
 
class  Comment
 The Comment class represents a comment in the code area. More...
 
class  Compiler
 The Compiler class provides API for compiling Scratch scripts. More...
 
class  CompilerConstant
 The CompilerConstant class represents a constant value in compiled code. More...
 
class  CompilerContext
 The CompilerContext represents a context for a specific target which is used with the Compiler class. More...
 
class  CompilerLocalVariable
 The CompilerLocalVariable class represents a statically typed local variable in compiled code. More...
 
class  CompilerValue
 The CompilerValue class represents a local value in compiled code. More...
 
class  Costume
 The Costume class represents a Scratch costume. More...
 
class  Drawable
 The Drawable class is the base class of rendered elements (stage, sprites, text bubbles). More...
 
class  Entity
 The Entity class is the base class of everything that is identified by an ID (Target, Variable, List, etc.). More...
 
class  ExecutableCode
 The ExecutableCode class represents the code of a compiled Scratch script. More...
 
class  ExecutionContext
 The ExecutionContext represents the execution context of a target (can be a clone) with variables, lists, etc. More...
 
class  Field
 The Field class represents a Scratch block field. More...
 
class  IEngine
 The IEngine interface provides an API for running Scratch projects. More...
 
class  IExtension
 The IExtension class is an interface for extensions. More...
 
class  IGraphicsEffect
 The IGraphicsEffects class is an interface for custom graphics effects. More...
 
class  IMonitorHandler
 
class  Input
 The Input class represents a Scratch block input. More...
 
class  InputValue
 The InputValue class provides methods for the value of an Input. More...
 
class  IRandomGenerator
 The IRandomGenerator interface represents a random number generator that can be received e. g. from an ExecutionContext. More...
 
class  ISpriteHandler
 The ISpriteHandler class provides a sprite interface for Scratch project players. More...
 
class  IStackTimer
 The IStackTimer interface represents a timer that can be used by blocks. More...
 
class  IStageHandler
 The IStageHandler class provides a stage interface for Scratch project players. More...
 
class  ITimer
 The ITimer interface represents a timer of a Scratch project. More...
 
class  KeyEvent
 The KeyEvent class represents a Scratch key event. More...
 
class  List
 The List class represents a Scratch list. More...
 
class  Monitor
 The Monitor class represents a stage monitor. More...
 
class  Project
 The Project class provides API for reading and running Scratch projects. More...
 
class  Promise
 The Promise class represents the eventual completion of an asynchronous operation. More...
 
class  Rect
 
class  ScratchConfiguration
 The ScratchConfiguration class provides methods for adding custom extensions. More...
 
class  Script
 The Script class represents a compiled Scratch script. More...
 
class  Sound
 The Sound class represents a Scratch sound. More...
 
class  Sprite
 The Sprite class represents a Scratch sprite. More...
 
class  Stage
 The Stage class is the project stage. More...
 
struct  StringPtr
 The StringPtr struct holds a string data pointer and string size. More...
 
class  Target
 The Target class is the Stage or a Sprite. More...
 
class  TextBubble
 The TextBubble class represents a text bubble created using say or think block. More...
 
class  Thread
 The Thread class represents a running Scratch script. More...
 
class  Value
 The Value class represents a Scratch value. More...
 
struct  ValueData
 The ValueData struct holds the data of Value. It's used in compiled Scratch code for better performance. More...
 
class  Variable
 The Variable class represents a Scratch variable. More...
 

Typedefs

using BlockComp = CompilerValue *(*)(Compiler *)
 
using MonitorNameFunc = const std::string &(*)(Block *)
 
using MonitorChangeFunc = void (*)(Block *, const Value &newValue)
 
using HatPredicateCompileFunc = CompilerValue *(*)(Compiler *vm)
 
using Rgb = unsigned int
 

Functions

constexpr bool enable_enum_bitmask (Compiler::StaticType)
 
template<typename T>
constexpr std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T > operator| (const T lhs, const T rhs)
 
template<typename T>
constexpr std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T & > operator|= (T &lhs, const T rhs)
 
template<typename T>
constexpr std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T > operator& (const T lhs, const T rhs)
 
template<typename T>
constexpr std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T & > operator&= (T &lhs, const T rhs)
 
template<typename T>
constexpr std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T > operator~ (const T value)
 
LIBSCRATCHCPP_EXPORT void string_alloc (StringPtr *str, size_t size)
 
LIBSCRATCHCPP_EXPORT void string_assign (StringPtr *str, const StringPtr *another)
 
LIBSCRATCHCPP_EXPORT void string_assign_cstring (StringPtr *str, const char *another)
 
LIBSCRATCHCPP_EXPORT int string_compare_raw_case_sensitive (const char16_t *str1, size_t n1, const char16_t *str2, size_t n2)
 
LIBSCRATCHCPP_EXPORT int string_compare_case_sensitive (const StringPtr *str1, const StringPtr *str2)
 
LIBSCRATCHCPP_EXPORT int string_compare_raw_case_insensitive (const char16_t *str1, size_t n1, const char16_t *str2, size_t n2)
 
LIBSCRATCHCPP_EXPORT int string_compare_case_insensitive (const StringPtr *str1, const StringPtr *str2)
 
LIBSCRATCHCPP_EXPORT bool string_contains_raw_case_sensitive (const char16_t *str, const char16_t *substr)
 
LIBSCRATCHCPP_EXPORT bool string_contains_case_sensitive (const StringPtr *str, const StringPtr *substr)
 
LIBSCRATCHCPP_EXPORT bool string_contains_raw_case_insensitive (const char16_t *str, const char16_t *substr)
 
LIBSCRATCHCPP_EXPORT bool string_contains_case_insensitive (const StringPtr *str, const StringPtr *substr)
 
LIBSCRATCHCPP_EXPORT StringPtrstring_pool_new ()
 
LIBSCRATCHCPP_EXPORT void string_pool_free (StringPtr *str)
 
constexpr int red (Rgb rgb)
 
constexpr int green (Rgb rgb)
 
constexpr int blue (Rgb rgb)
 
constexpr int alpha (Rgb rgb)
 
constexpr Rgb rgb (int r, int g, int b)
 
constexpr Rgb rgba (int r, int g, int b, int a)
 
void value_free (ValueData *v)
 
void value_init (ValueData *v)
 
void value_assign_double (ValueData *v, double numberValue)
 
void value_assign_bool (ValueData *v, bool boolValue)
 
void value_assign_string (ValueData *v, const std::string &stringValue)
 
void value_assign_cstring (ValueData *v, const char *stringValue)
 
void value_assign_stringPtr (ValueData *v, const StringPtr *stringValue)
 
void value_assign_pointer (ValueData *v, const void *pointerValue)
 
void value_assign_copy (ValueData *v, const ValueData *another)
 
bool value_isInfinity (const ValueData *v)
 
bool value_isNegativeInfinity (const ValueData *v)
 
bool value_isNaN (const ValueData *v)
 
bool value_isNumber (const ValueData *v)
 
bool value_isValidNumber (const ValueData *v)
 
bool value_isInt (const ValueData *v)
 
bool value_isBool (const ValueData *v)
 
bool value_isString (const ValueData *v)
 
bool value_isPointer (const ValueData *v)
 
long value_toLong (const ValueData *v)
 
int value_toInt (const ValueData *v)
 
double value_toDouble (const ValueData *v)
 
bool value_toBool (const ValueData *v)
 
void value_toString (const ValueData *v, std::string *dst)
 
void value_toStringPtr (const ValueData *v, StringPtr *dst)
 
void value_toUtf16 (const ValueData *v, std::u16string *dst)
 
Rgb value_toRgba (const ValueData *v)
 
const void * value_toPointer (const ValueData *v)
 
bool value_doubleIsInt (double v)
 
void value_doubleToStringPtr (double v, StringPtr *dst)
 
const StringPtrvalue_boolToStringPtr (bool v)
 
double value_stringToDouble (const StringPtr *s)
 
double value_stringToDoubleWithCheck (const StringPtr *s, bool *ok)
 
bool value_stringToBool (const StringPtr *s)
 
void value_add (const ValueData *v1, const ValueData *v2, ValueData *dst)
 
void value_subtract (const ValueData *v1, const ValueData *v2, ValueData *dst)
 
void value_multiply (const ValueData *v1, const ValueData *v2, ValueData *dst)
 
void value_divide (const ValueData *v1, const ValueData *v2, ValueData *dst)
 
void value_mod (const ValueData *v1, const ValueData *v2, ValueData *dst)
 
bool value_equals (const ValueData *v1, const ValueData *v2)
 
bool value_greater (const ValueData *v1, const ValueData *v2)
 
bool value_lower (const ValueData *v1, const ValueData *v2)
 
void list_clear (List *list)
 
void list_remove (List *list, size_t index)
 
ValueDatalist_append_empty (List *list)
 
ValueDatalist_insert_empty (List *list, size_t index)
 
ValueDatalist_get_item (List *list, size_t index)
 
ValueDatalist_data (List *list)
 
ValueData *const * list_data_ptr (List *list)
 
size_t * list_size_ptr (List *list)
 
const size_t * list_alloc_size_ptr (List *list)
 
size_t list_size (List *list)
 
void list_to_string (List *list, StringPtr *dst)
 
int string_compare_raw_case_sensitive_inline (const char16_t *str1, size_t n1, const char16_t *str2, size_t n2)
 
int string_compare_raw_case_insensitive_inline (const char16_t *str1, size_t n1, const char16_t *str2, size_t n2)
 
bool string_contains_raw_case_sensitive_inline (const char16_t *str, const char16_t *substr)
 
bool string_contains_raw_case_insensitive_inline (const char16_t *str, const char16_t *substr)
 

Detailed Description

The main namespace of the library.

Typedef Documentation

◆ BlockComp

BlockComp is a function pointer for functions which are used to compile blocks.

◆ HatPredicateCompileFunc

HatPredicateCompileFunc is a function pointer for functions which are used to compile edge-activated hat predicates.

◆ MonitorChangeFunc

using libscratchcpp::MonitorChangeFunc = void (*)(Block *, const Value &newValue)

MonitorChangeFunc is a function pointer for functions which are used to change monitor values.

◆ MonitorNameFunc

using libscratchcpp::MonitorNameFunc = const std::string &(*)(Block *)

MonitorNameFunc is a function pointer for functions which are used to get monitor names.

◆ Rgb

using libscratchcpp::Rgb = unsigned int

A typedef for unsigned int. Holds the RGBA values.

Function Documentation

◆ alpha()

int libscratchcpp::alpha ( Rgb rgb)
inlineconstexpr

Returns the alpha component of the quadruplet rgb.

◆ blue()

int libscratchcpp::blue ( Rgb rgb)
inlineconstexpr

Returns the blue component of the quadruplet rgb.

◆ enable_enum_bitmask()

bool libscratchcpp::enable_enum_bitmask ( Compiler::StaticType )
constexpr

◆ green()

int libscratchcpp::green ( Rgb rgb)
inlineconstexpr

Returns the green component of the quadruplet rgb.

◆ list_alloc_size_ptr()

const size_t * libscratchcpp::list_alloc_size_ptr ( List * list)

◆ list_append_empty()

ValueData * libscratchcpp::list_append_empty ( List * list)

◆ list_clear()

void libscratchcpp::list_clear ( List * list)

◆ list_data()

ValueData * libscratchcpp::list_data ( List * list)

◆ list_data_ptr()

ValueData *const * libscratchcpp::list_data_ptr ( List * list)

◆ list_get_item()

ValueData * libscratchcpp::list_get_item ( List * list,
size_t index )

◆ list_insert_empty()

ValueData * libscratchcpp::list_insert_empty ( List * list,
size_t index )

◆ list_remove()

void libscratchcpp::list_remove ( List * list,
size_t index )

◆ list_size()

size_t libscratchcpp::list_size ( List * list)

◆ list_size_ptr()

size_t * libscratchcpp::list_size_ptr ( List * list)

◆ list_to_string()

void libscratchcpp::list_to_string ( List * list,
StringPtr * dst )

◆ operator&()

template<typename T>
std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T > libscratchcpp::operator& ( const T lhs,
const T rhs )
constexpr

◆ operator&=()

template<typename T>
std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T & > libscratchcpp::operator&= ( T & lhs,
const T rhs )
constexpr

◆ operator|()

template<typename T>
std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T > libscratchcpp::operator| ( const T lhs,
const T rhs )
constexpr

◆ operator|=()

template<typename T>
std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T & > libscratchcpp::operator|= ( T & lhs,
const T rhs )
constexpr

◆ operator~()

template<typename T>
std::enable_if_t< std::conjunction_v< std::is_enum< T >, std::is_same< bool, decltype(enable_enum_bitmask(std::declval< T >()))> >, T > libscratchcpp::operator~ ( const T value)
constexpr

◆ red()

int libscratchcpp::red ( Rgb rgb)
inlineconstexpr

Returns the red component of the quadruplet rgb.

◆ rgb()

Rgb libscratchcpp::rgb ( int r,
int g,
int b )
inlineconstexpr

Creates an RGB triplet from the given color components.

◆ rgba()

Rgb libscratchcpp::rgba ( int r,
int g,
int b,
int a )
inlineconstexpr

Creates an RGBA quadruplet from the given color components.

◆ string_alloc()

void libscratchcpp::string_alloc ( StringPtr * str,
size_t size )

Ensures at least the given size is allocated on str.

◆ string_assign()

void libscratchcpp::string_assign ( StringPtr * str,
const StringPtr * another )

Assigns the given string to str.

◆ string_assign_cstring()

void libscratchcpp::string_assign_cstring ( StringPtr * str,
const char * another )

Assigns the given string to str.

◆ string_compare_case_insensitive()

int libscratchcpp::string_compare_case_insensitive ( const StringPtr * str1,
const StringPtr * str2 )

◆ string_compare_case_sensitive()

int libscratchcpp::string_compare_case_sensitive ( const StringPtr * str1,
const StringPtr * str2 )

◆ string_compare_raw_case_insensitive()

int libscratchcpp::string_compare_raw_case_insensitive ( const char16_t * str1,
size_t n1,
const char16_t * str2,
size_t n2 )

◆ string_compare_raw_case_insensitive_inline()

int libscratchcpp::string_compare_raw_case_insensitive_inline ( const char16_t * str1,
size_t n1,
const char16_t * str2,
size_t n2 )
inline

◆ string_compare_raw_case_sensitive()

int libscratchcpp::string_compare_raw_case_sensitive ( const char16_t * str1,
size_t n1,
const char16_t * str2,
size_t n2 )

◆ string_compare_raw_case_sensitive_inline()

int libscratchcpp::string_compare_raw_case_sensitive_inline ( const char16_t * str1,
size_t n1,
const char16_t * str2,
size_t n2 )
inline

◆ string_contains_case_insensitive()

bool libscratchcpp::string_contains_case_insensitive ( const StringPtr * str,
const StringPtr * substr )

Returns true if the string contains the given substring (case insensitive).

◆ string_contains_case_sensitive()

bool libscratchcpp::string_contains_case_sensitive ( const StringPtr * str,
const StringPtr * substr )

Returns true if the string contains the given substring (case sensitive).

◆ string_contains_raw_case_insensitive()

bool libscratchcpp::string_contains_raw_case_insensitive ( const char16_t * str,
const char16_t * substr )

Returns true if the string contains the given substring (case insensitive).

◆ string_contains_raw_case_insensitive_inline()

bool libscratchcpp::string_contains_raw_case_insensitive_inline ( const char16_t * str,
const char16_t * substr )
inline

◆ string_contains_raw_case_sensitive()

bool libscratchcpp::string_contains_raw_case_sensitive ( const char16_t * str,
const char16_t * substr )

Returns true if the string contains the given substring (case sensitive).

◆ string_contains_raw_case_sensitive_inline()

bool libscratchcpp::string_contains_raw_case_sensitive_inline ( const char16_t * str,
const char16_t * substr )
inline

◆ string_pool_free()

void libscratchcpp::string_pool_free ( StringPtr * str)

Invalidates the given StringPtr so that it can be used for new strings later.

◆ string_pool_new()

StringPtr * libscratchcpp::string_pool_new ( )

Use this instead of dynamically allocating StringPtr.

Note
The returned string is uninitialized. Use e. g. string_assign_cstring() to initialize it.

◆ value_add()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_add ( const libscratchcpp::ValueData * v1,
const libscratchcpp::ValueData * v2,
ValueData * dst )

Adds the given values and writes the result to dst.

◆ value_assign_bool()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_bool ( ValueData * v,
bool boolValue )

Assigns boolean to the given value.

◆ value_assign_copy()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_copy ( ValueData * v,
const libscratchcpp::ValueData * another )

Assigns another value to the given value.

◆ value_assign_cstring()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_cstring ( ValueData * v,
const char * stringValue )

Assigns C string to the given value.

◆ value_assign_double()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_double ( ValueData * v,
double numberValue )

Assigns number of type 'double' to the given value.

◆ value_assign_pointer()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_pointer ( ValueData * v,
const void * pointerValue )

Assigns pointer to the given value.

◆ value_assign_string()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_string ( ValueData * v,
const std::string & stringValue )

Assigns string to the given value.

◆ value_assign_stringPtr()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_assign_stringPtr ( ValueData * v,
const StringPtr * stringValue )

Assigns string to the given value.

◆ value_boolToStringPtr()

LIBSCRATCHCPP_EXPORT const StringPtr * libscratchcpp::value_boolToStringPtr ( bool v)

Converts the given boolean to string.

Note
Do not free the string!

◆ value_divide()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_divide ( const libscratchcpp::ValueData * v1,
const libscratchcpp::ValueData * v2,
ValueData * dst )

Divides the given values and writes the result to dst.

◆ value_doubleIsInt()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_doubleIsInt ( double v)

Returns true if the given number represents a round integer.

◆ value_doubleToStringPtr()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_doubleToStringPtr ( double v,
StringPtr * dst )

Converts the given number to string and stores the result in dst.

◆ value_equals()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_equals ( const libscratchcpp::ValueData * v1,
const libscratchcpp::ValueData * v2 )

Returns true if the given values are equal.

◆ value_free()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_free ( ValueData * v)

Frees memory used by the given value if it's a string.

◆ value_greater()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_greater ( const libscratchcpp::ValueData * v1,
const libscratchcpp::ValueData * v2 )

Returns true if the first value is greater than the second value.

◆ value_init()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_init ( ValueData * v)

Initializes the given value.

◆ value_isBool()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isBool ( const libscratchcpp::ValueData * v)

Returns true if the given value is a boolean.

◆ value_isInfinity()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isInfinity ( const libscratchcpp::ValueData * v)

Returns true if the given value is Infinity.

◆ value_isInt()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isInt ( const ValueData * v)

Returns true if the given value represents a round integer.

◆ value_isNaN()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isNaN ( const libscratchcpp::ValueData * v)

Returns true if the given value is NaN.

◆ value_isNegativeInfinity()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isNegativeInfinity ( const libscratchcpp::ValueData * v)

Returns true if the given value is -Infinity.

◆ value_isNumber()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isNumber ( const libscratchcpp::ValueData * v)

Returns true if the given value is a number.

◆ value_isPointer()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isPointer ( const ValueData * v)

Returns true if the given value is a pointer.

◆ value_isString()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isString ( const libscratchcpp::ValueData * v)

Returns true if the given value is a string.

◆ value_isValidNumber()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_isValidNumber ( const libscratchcpp::ValueData * v)

Returns true if the given value is a number or can be converted to a number.

◆ value_lower()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_lower ( const libscratchcpp::ValueData * v1,
const libscratchcpp::ValueData * v2 )

Returns true if the first value is lower than the second value.

◆ value_mod()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_mod ( const libscratchcpp::ValueData * v1,
const libscratchcpp::ValueData * v2,
ValueData * dst )

Calculates the modulo the given values and writes the result to dst.

◆ value_multiply()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_multiply ( const libscratchcpp::ValueData * v1,
const libscratchcpp::ValueData * v2,
ValueData * dst )

Multiplies the given values and writes the result to dst.

◆ value_stringToBool()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_stringToBool ( const StringPtr * s)

Converts the given string to boolean.

◆ value_stringToDouble()

LIBSCRATCHCPP_EXPORT double libscratchcpp::value_stringToDouble ( const StringPtr * s)

Converts the given string to double.

◆ value_stringToDoubleWithCheck()

LIBSCRATCHCPP_EXPORT double libscratchcpp::value_stringToDoubleWithCheck ( const StringPtr * s,
bool * ok )

Converts the given string to double.

Parameters
[out]okWhether the conversion was successful.

◆ value_subtract()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_subtract ( const libscratchcpp::ValueData * v1,
const libscratchcpp::ValueData * v2,
ValueData * dst )

Subtracts the given values and writes the result to dst.

◆ value_toBool()

LIBSCRATCHCPP_EXPORT bool libscratchcpp::value_toBool ( const libscratchcpp::ValueData * v)

Returns the boolean representation of the given value.

◆ value_toDouble()

LIBSCRATCHCPP_EXPORT double libscratchcpp::value_toDouble ( const libscratchcpp::ValueData * v)

Returns the double representation of the given value.

◆ value_toInt()

LIBSCRATCHCPP_EXPORT int libscratchcpp::value_toInt ( const libscratchcpp::ValueData * v)

Returns the int representation of the given value.

◆ value_toLong()

LIBSCRATCHCPP_EXPORT long libscratchcpp::value_toLong ( const libscratchcpp::ValueData * v)

Returns the long representation of the given value.

◆ value_toPointer()

LIBSCRATCHCPP_EXPORT const void * libscratchcpp::value_toPointer ( const ValueData * v)

Returns the pointer stored in the given value or nullptr if it isn't a pointer.

◆ value_toRgba()

LIBSCRATCHCPP_EXPORT Rgb libscratchcpp::value_toRgba ( const ValueData * v)

Returns the RGBA quadruplet from the given color value.

◆ value_toString()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_toString ( const ValueData * v,
std::string * dst )

Writes the string representation of the given value to dst.

◆ value_toStringPtr()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_toStringPtr ( const ValueData * v,
StringPtr * dst )

Writes the string representation of the given value to dst.

◆ value_toUtf16()

LIBSCRATCHCPP_EXPORT void libscratchcpp::value_toUtf16 ( const libscratchcpp::ValueData * v,
std::u16string * dst )

Writes the UTF-16 representation of the given value to dst.