https://github.com/open-source-parsers/jsoncpp
GitHub - open-source-parsers/jsoncpp: A C++ library for interacting with JSON.
A C++ library for interacting with JSON. Contribute to open-source-parsers/jsoncpp development by creating an account on GitHub.
github.com
git clone https://github.com/open-source-parsers/jsoncpp.git
๋ ํฌ์งํ ๋ฆฌ ์ค์น ํ ํ์ด์ฌ์ผ๋ก ๋น๋
python amalgamate.py
dist ํด๋๋ก ๋ค์ด๊ฐ๋ฉด ํค๋ ํ์ผ ํด๋์ ์์ค ํ์ผ์ด ์์ฑ์ด ๋์ด์์
1. ๋น์ฃผ์ผ ์คํ๋์ค์์ ํ๋ก์ ํธ ์์ฑ -> C/C++ -> ์ผ๋ฐ -> ์ถ๊ฐ ํฌํจ ๋๋ ํฐ๋ฆฌ์ json ํค๋ ๊ฒฝ๋ก ๋ฑ๋ก
2. ํ์๊ธฐ์ ์์ค ํ์ผ์๋ค jsoncpp.cpp ์์ค ํ์ผ ์ ๋ก๋
[์์]
#include <iostream>
#include <json.h>
std::string str;
int main()
{
std::cout << "Hello World!\n";
Json::Value root;
root["id"] = "Luna";
root["name"] = "Silver";
root["age"] = 19;
root["hasCar"] = false;
Json::Value items;
items.append("nootbook");
items.append("ipadmini2");
items.append("iphone5s");
root["items"] = items;
Json::Value friends;
Json::Value tom;
tom["name"] = "Tom";
tom["age"] = 21;
Json::Value jane;
jane["name"] = "jane";
jane["age"] = 23;
friends.append(tom);
friends.append(jane);
root["friends"] = friends;
Json::StyledWriter writer;
str = writer.write(root);
std::cout << str << std::endl;
}
์ฐธ๊ณ :
https://devluna.blogspot.com/2015/09/jsoncpp-c-json-parsing.html
jsoncpp ๋ฅผ ์ด์ฉํ์ฌ C++์์ JSON ์์ฑ ๋ฐ Parsing ํ๊ธฐ
Software Development, Database, C++, Visual C++, Modern C++, Oracle, IBM DB2
devluna.blogspot.com
C++์์ JSON ์ฌ์ฉ
C++์์ JSON ์ฌ์ฉ JSON ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ ํฉ์ฑ๊ณผ ์ฑ๋ฅ์ ํ๊ฐํ ๋งํฌ c++ ์ json ๋ผ์ด๋ธ๋ฌ๋ฆฌ = JSONKIT, jsoncpp, rapidjson, zoolib, jvar ๋ฑ๋ฑ ๋ํ์ ์ผ๋ก ๋ง์ด ์ฌ์ฉ๋๋ jsoncpp, Rapid Json, nlohmann json์ด ์..
ikcoo.tistory.com
'๐จ๐ผโ๐ป๊ฐ๋ฐ > C | C++' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
C/C++ - DLL ๋ง๋ค๊ธฐ, DLL ์ฌ์ฉํ๊ธฐ (GCC) (0) | 2023.03.23 |
---|---|
C++ - ๋น์ฃผ์ผ ์คํ๋์ค E1696 : ํ์ผ ์์ค์(๋ฅผ) ์ด ์ ์์ต๋๋ค. ํด๊ฒฐ ๋ฐฉ๋ฒ (0) | 2022.06.27 |