[JsonCpp] Json 문자열 파싱 int main(){ std::string jsonString = R"({ "PlayerName": "testid", "PlayerHP": 20, "Items": ["Potion1", "Potion2"] })"; Json::Value root; Json::CharReaderBuilder reader; std::string errs; std::istringstream s(jsonString); if (!Json::parseFromStream(reader, s, &root, &errs)) { std::cerr 2025. 3. 22. [JsonCpp] 설치 1. Git에서 소스코드를 Clonegit clone https://github.com/open-source-parsers/jsoncpp.git 2-1. 소스 코드로 추가해서 사용1. Clone 한 경로에서 amalgamate.py 파이썬을 실행(파이썬은 설치되어있어야 한다) 2. dist폴더에 소스 파일들이 생성됨- jsoncpp.cpp- json/json.h- json/json-forwards.h 3. 해당 소스 파일을 사용할 프로젝트에 추가해서 사용- 폴더 구조는 그대로 맞춰줘야 함.(jsoncpp.cpp가 json/json.h 형태로 헤더를 참조) 4. 파일 2025. 3. 22. 이전 1 다음