Major string_view refactor. Added namespace sv

This commit is contained in:
2022-04-16 02:26:32 -04:00
parent b6d603034e
commit d2c81e640d
13 changed files with 381 additions and 309 deletions

View File

@@ -5,6 +5,8 @@
#include "gui.hpp"
#include "traceback.hpp"
#include "pprint.hpp"
#include "util.hpp"
#include <iostream>
void World::store_global_pointer(lua_State *L, World *v) {
@@ -434,7 +436,7 @@ void World::invoke_flush_prints(int64_t actor_id, int64_t place_id, const eng::s
if (actor_id != place_id) {
return;
}
int64_t line = util::str_to_int64(action, -1);
int64_t line = sv::to_int64(action, -1);
if ((line < 0)||(line > INT_MAX)) {
return;
}
@@ -530,7 +532,7 @@ void World::invoke_plan(int64_t actor_id, int64_t place_id, const eng::string &a
}
// Make sure the action starts with "cb_"
if (!util::has_prefix(action, "cb_")) {
if (!sv::has_prefix(action, "cb_")) {
return;
}