mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
refactor(json): migrate from nlohmann to rapidjson
Replace nlohmann::json with rapidjson across localization, hitbox manager, server world, and sensitive filter. Add json_utils helper for converting rapidjson documents to maps, and improve parse error handling.
This commit is contained in:
8
include/Cubed/tools/json_utils.hpp
Normal file
8
include/Cubed/tools/json_utils.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
#include <rapidjson/document.h>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
namespace Tools {
|
||||
std::unordered_map<std::string, std::string>
|
||||
doc_to_map(const rapidjson::Document& doc);
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <rapidjson/document.h>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
namespace Cubed {
|
||||
class SensitiveFilter {
|
||||
public:
|
||||
SensitiveFilter();
|
||||
void load(const nlohmann::json& j);
|
||||
void load(const rapidjson::Document& doc);
|
||||
std::string filter(std::string_view text);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user