Add setters.
This commit is contained in:
parent
ee587d0b9e
commit
dafce95c8f
2 changed files with 31 additions and 1 deletions
|
@ -4,7 +4,6 @@
|
|||
#include <wren.hpp>
|
||||
#include <cassert>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
namespace wren {
|
||||
namespace {
|
||||
|
@ -182,6 +181,30 @@ namespace wren {
|
|||
return static_cast<int>(slot<double>(slot_num));
|
||||
}
|
||||
|
||||
void VM::set (int slot_num, const std::string& value) {
|
||||
wrenSetSlotString(m_local->wvm, slot_num, value.c_str());
|
||||
}
|
||||
|
||||
void VM::set (int slot_num, const char* value) {
|
||||
wrenSetSlotString(m_local->wvm, slot_num, value);
|
||||
}
|
||||
|
||||
void VM::set (int slot_num, double value) {
|
||||
wrenSetSlotDouble(m_local->wvm, slot_num, value);
|
||||
}
|
||||
|
||||
void VM::set (int slot_num, bool value) {
|
||||
wrenSetSlotBool(m_local->wvm, slot_num, value);
|
||||
}
|
||||
|
||||
void VM::set (int slot_num, const std::vector<char>& value) {
|
||||
wrenSetSlotBytes(m_local->wvm, slot_num, value.data(), value.size());
|
||||
}
|
||||
|
||||
void VM::set (int slot_num, std::nullptr_t) {
|
||||
wrenSetSlotNull(m_local->wvm, slot_num);
|
||||
}
|
||||
|
||||
void VM::ensure_slots (int num_slots) {
|
||||
wrenEnsureSlots(m_local->wvm, num_slots);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue