emsApplication/applications/examples/jsondemo2/main.cpp

25 lines
391 B
C++
Raw Normal View History

2024-06-05 21:07:54 +08:00
#include "openjson.h"
#include <iostream>
#include <assert.h>
int main()
{
std::string buff1;
OpenJson json;
auto& nodeRoot = json["users"];
size_t i = 0;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
while (i < 3)
{
auto& node = nodeRoot[i];
node["id"] = "userid";
node["user"] = "user";
node["passwd"] = "passwordpassword";
node["salt"] = "saltsaltsalt";
i++;
}
buff1 = json.encode();
return 0;
}