API: JS: VM: Getter - ov-studio/Vital.sandbox GitHub Wiki

━ Methods

━ vm::getArgCount()

@Objective: Retrieves argument count (number of elements inside the stack)
int result = vm -> getArgCount();

━ vm::getGlobal()

@Objective: Pushes value of global object's specified index at the top of the stack.
ℹ️ _G[index]
bool result = vm -> getGlobal(std::string index);

━ vm::getBool()

@Objective: Retrieves bool value from stack's specified index.
bool result = vm -> getBool(int index = 1);

━ vm::getString()

@Objective: Retrieves string value from stack's specified index.
std::string result = vm -> getString(int index = 1);

━ vm::getInt()

@Objective: Retrieves number (integer) value from stack's specified index.
int result = vm -> getInt(int index = 1);

━ vm::getFloat()

@Objective: Retrieves number (float) value from stack's specified index.
float result = vm -> getFloat(int index = 1);

━ vm::getDouble()

@Objective: Retrieves number (double) value from stack's specified index.
double result = vm -> getDouble(int index = 1);

━ vm::getArray()

@Objective: Pops topmost value as index of array (located at specified index) and pushes its value at the top of the stack.
ℹ️ index[(topmost value, i.e value at stack index -1)]
bool result = vm -> getArray(int index = 1);

━ vm::getObject()

@Objective: Pops topmost value as index of object (located at specified index) and pushes its value at the top of the stack.
ℹ️ index[(topmost value, i.e value at stack index -1)]
bool result = vm -> getObject(int index = 1);

━ vm::getArrayField()

@Objective: Fetches value of array (located at specified index) from provided index value and pushes it at the top of the stack.
ℹ️ index[value]
bool result = vm -> getArrayField(int value, int index = 1);

━ vm::getObjectField()

@Objective: Fetches value of object (located at specified index) from provided index value and pushes it at the top of the stack.
ℹ️ index[value]
bool result = vm -> getObjectField(std::string value, int index = 1);

━ vm::getUserData()

@Objective: Retrieves userdata value from stack's specified index.
void* result = vm -> getUserData(int index = 1);

━ vm::getLength()

@Objective: Retrieves length of value at stack's specified index.
int result = vm -> getLength(int index = 1);