mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
migrate from dynamic::Value to dv::value & total erase namespace 'dynamic'
This commit is contained in:
parent
d3ba4b2e3e
commit
34d2e6d400
69 changed files with 1247 additions and 2248 deletions
|
|
@ -1,17 +1,12 @@
|
|||
#include "coders/json.hpp"
|
||||
#include "data/dynamic.hpp"
|
||||
#include "api_lua.hpp"
|
||||
|
||||
static int l_json_stringify(lua::State* L) {
|
||||
auto value = lua::tovalue(L, 1);
|
||||
|
||||
if (auto mapptr = std::get_if<dynamic::Map_sptr>(&value)) {
|
||||
bool nice = lua::toboolean(L, 2);
|
||||
auto string = json::stringify(mapptr->get(), nice, " ");
|
||||
return lua::pushstring(L, string);
|
||||
} else {
|
||||
throw std::runtime_error("table expected");
|
||||
}
|
||||
bool nice = lua::toboolean(L, 2);
|
||||
auto string = json::stringify(value, nice, " ");
|
||||
return lua::pushstring(L, string);
|
||||
}
|
||||
|
||||
static int l_json_parse(lua::State* L) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue