23 lines
670 B
C++
23 lines
670 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <cstddef>
|
|
|
|
struct lua_State;
|
|
|
|
namespace mosis {
|
|
|
|
// Configuration limits for JSON operations
|
|
struct JsonLimits {
|
|
int max_depth = 32; // Maximum nesting depth
|
|
size_t max_string_length = 1 * 1024 * 1024; // 1 MB per string
|
|
size_t max_output_size = 10 * 1024 * 1024; // 10 MB total output
|
|
size_t max_array_size = 100000; // Max elements in array
|
|
size_t max_object_size = 10000; // Max keys in object
|
|
};
|
|
|
|
// Register json.encode() and json.decode() as globals
|
|
void RegisterJsonAPI(lua_State* L, const JsonLimits& limits = JsonLimits{});
|
|
|
|
} // namespace mosis
|