Initial pure C++ implementation
ci / ubuntu-latest (push) Failing after 13s
ci / macos-latest (push) Has been cancelled
ci / windows-latest (push) Has been cancelled

This commit is contained in:
2026-09-25 04:17:30 +08:00
commit 42d6da6302
110 changed files with 37510 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#pragma once
#include <string>
#include <utility>
#include <vector>
namespace joc::json {
struct Member {
std::string key;
std::string raw;
bool is_string = false;
};
// Parses a top-level JSON object. Rejects non-objects and duplicate keys.
bool parse_object(const std::string& text, std::vector<Member>* out, std::string* error);
const Member* find(const std::vector<Member>& members, const std::string& key);
bool as_string(const Member& member, std::string* out);
bool as_number(const Member& member, double* out);
bool as_integer(const Member& member, long long* out);
} // namespace joc::json