vs http jhrogue blogspot com OKdev TV 5
참고 자료 • <컴퓨터 vs 책> 블로그 • http: //jhrogue. blogspot. com/ • OKdev. TV 유튜브 방송 • 5분 따라하기 리스트: • https: //www. youtube. com/playlist? list=PLdnt. WJk 2 t. JPLKNNYBVCxnde 2 PEB 6 d zb. SL • 슬라이드 셰어 • https: //www. slideshare. net/jrogue/presentations • ASCIINEMA • https: //asciinema. org/~jrogue
설치 • $ • $ • $ git clone https: //github. com/Microsoft/vcpkg. git cd vcpkg. /bootstrap-vcpkg. sh. /vcpkg integrate install. /vcpkg search | grep json. /vcpkg install nlohmann-json
실행 결과(예시) $ git clone https: //github. com/Microsoft/vcpkg. git Cloning into 'vcpkg'. . . remote: Enumerating objects: 1, done. remote: Counting objects: 100% (1/1), done. remote: Total 86762 (delta 0), reused 0 (delta 0), pack-reused 86761 Receiving objects: 100% (86762/86762), 25. 61 Mi. B | 8. 41 Mi. B/s, done. Resolving deltas: 100% (53902/53902), done. Updating files: 100% (5288/5288), done. $. /bootstrap-vcpkg. sh $. /vcpkg integrate install Applied user-wide integration for this vcpkg root. Building vcpkg. exe. . . pch. cpp archives. cpp checks. cpp chrono. cpp. . . vcpkgpaths. cpp versiont. cpp visualstudio. cpp vcpkg. cpp. . . Building vcpkg. exe. . . done. All MSBuild C++ projects can now #include any installed libraries. Linking will be handled automatically. Installing new libraries will make them instantly available. CMake projects should use: "DCMAKE_TOOLCHAIN_FILE=C: /Users/jaypark/vcpkg/scripts/buildsystems/vcpkg. cmake"
실행 결과(예시) $. /vcpkg search | grep json arrow[json] bitserializer[cpprestjson-archive] bitserializer[rapidjson-archive] bitserializer-cpp. . . alias bitserializer-rap. . . alias cjson 2019 -11 -30 -1 cjson[utils] json-c 2019 -09 -10 json-dto 0. 2. 9. 2 json-schema-valid. . . 2. 1. 0 json-spirit 4. 1. 0 -1 json 11 2017 -06 -20 -2 json 5 -parser 1. 0. 0 -1 jsoncons 0. 155. 1 jsoncpp 1. 9. 2 jsonnet 0. 14. 0 -1 jwt-cpp 0. 4. 0 nlohmann-json 3. 9. 1 parson 2019 -07 -11 picojson 1. 3. 0 -1 rapidjson 2020 -02 -08 sajson 2018 -09 -21 simdjson 0. 4. 6 sqlite 3[json 1] taocpp-json 2019 -07 -11 valijson 2018 -11 -17 -1 JSON file support Module for support JSON (implementation based on the Cpp. Rest. SDK library) Module for support JSON (implementation based on the Rapid. Json library) Deprecated alias for bitserializer-cpprestjson Deprecated alias for bitserializer-rapidjson Ultralightweight JSON parser in ANSI C Enable building the c. JSON_Utils library A JSON implementation in C A small header-only library for converting data between json representation an. . . This is a C++ library for validating JSON documents based on a JSON Schema. Th. . . json parser using boost library json 11 is a tiny JSON library for C++11, providing JSON parsing and serializat. . . An enhancement of the JSON Spirit C++ library to understand json 5. A C++, header-only library for constructing JSON and JSON-like text and binary. . . jsoncpp is an implementation of a JSON reader and writer in C++. JSON (Java. Scr. . . Jsonnet - The data templating language A header only library for creating and validating json web tokens in c++ JSON for Modern C++ a lighweight json library written in C A header-file-only, JSON parser serializer in C++. A fast JSON parser/generator for C++ with both SAX/DOM style API <http: //rapid. . . Lightweight, extremely high-performance JSON parser for C++11 A extremely fast JSON library that can parse gigabytes of JSON per second enable JSON functionality for sqlite 3 C++ header-only JSON library Header-only C++ library for JSON Schema validation
실행 결과(예시) $. /vcpkg install nlohmann-json Computing installation plan. . . A suitable version of cmake was not found (required v 3. 17. 2). Downloading portable cmake v 3. 17. 2. . . Downloading cmake. . . https: //github. com/Kitware/CMake/releases/download/v 3. 17. 2/cmake-3. 17. 2 -win 32 -x 86. zip -> C: Usersjayparkdocumentsvcpkgdownloadscmake-3. 17. 2 -win 32 -x 86. zip Extracting cmake. . . A suitable version of 7 zip was not found (required v 18. 1. 0). Downloading portable 7 zip v 18. 1. 0. . . Downloading 7 zip. . . https: //www. nuget. org/api/v 2/package/7 -Zip. Command. Line/18. 1. 0 -> C: Usersjayparkdocumentsvcpkgdownloads7 zip. commandline. 18. 1. 0. nupkg Extracting 7 zip. . . A suitable version of nuget was not found (required v 5. 5. 1). Downloading portable nuget v 5. 5. 1. . . Downloading nuget. . . https: //dist. nuget. org/win-x 86 -commandline/v 5. 5. 1/nuget. exe -> C: Usersjayparkdocumentsvcpkgdownloads22 ea 847 d-nuget. exe The following packages will be built and installed: nlohmann-json[core]: x 86 -windows Detecting compiler hash for triplet x 86 -windows. . . A suitable version of powershell-core was not found (required v 6. 2. 1). Downloading portable powershell-core v 6. 2. 1. . . Downloading powershell-core. . . https: //github. com/Power. Shell/releases/download/v 6. 2. 1/Power. Shell-6. 2. 1 -win-x 86. zip -> C: UsersjayparkvcpkgdownloadsPower. Shell-6. 2. 1 -win-x 86. zip Extracting powershell-core. . .
실행 결과(예시) Starting package 1/1: nlohmann-json: x 86 -windows Building package nlohmann-json[core]: x 86 -windows. . . Could not locate cached archive: C: UsersjayparkApp. DataLocalvcpkg/archives1 e1 e 699 d 54 ec 05 be 35 d 7 ea 0 e 7 c 4 de 7 a 1672 bd 0 b 286. zip -- Downloading https: //github. com/nlohmann/json/raw/v 3. 9. 1/CMake. Lists. txt. . . -- Downloading https: //github. com/nlohmann/json/raw/v 3. 9. 1/LICENSE. MIT. . . -- Downloading https: //github. com/nlohmann/json/raw/v 3. 9. 1/nlohmann_json. natvis. . . -- Downloading https: //github. com/nlohmann/json/raw/v 3. 9. 1/cmake/config. cmake. in. . . -- Downloading https: //github. com/nlohmann/json/raw/v 3. 9. 1/cmake/pkg-config. pc. in. . . -- Downloading https: //github. com/nlohmann/json/raw/v 3. 9. 1/cmake/nlohmann_json. Config. Version. cmake. in. . . -- Downloading https: //github. com/nlohmann/json/releases/download/v 3. 9. 1/include. zip. . . -- Extracting source C: /Users/jaypark/documents/vcpkg/downloads/nlohmann-json-v 3. 9. 1 -include. zip -- Using source at C: /Users/jaypark/documents/vcpkg/buildtrees/nlohmann-json/3. 9. 1 -74 ced 61 d 52. clean -- Configuring x 86 -windows -- Building x 86 -windows-dbg -- Building x 86 -windows-rel -- Installing: C: /Users/jaypark/documents/vcpkg/packages/nlohmann-json_x 86 -windows/share/nlohmann-json/copyright -- Performing post-build validation done Stored binary cache: C: UsersjayparkApp. DataLocalvcpkg/archives1 e1 e 699 d 54 ec 05 be 35 d 7 ea 0 e 7 c 4 de 7 a 1672 bd 0 b 286. zip Building package nlohmann-json[core]: x 86 -windows. . . done Installing package nlohmann-json[core]: x 86 -windows. . . done Elapsed time for package nlohmann-json: x 86 -windows: 12. 56 s Total elapsed time: 30. 43 s The package nlohmann-json: x 86 -windows provides CMake targets: find_package(nlohmann_json CONFIG REQUIRED) target_link_libraries(main PRIVATE nlohmann_json: : nlohmann_json)
실제 사용(예시) #include <nlohmann/json. hpp> using nlohmann: : json; json j 1 = json: : parse(json_string); // 파싱 // 1 st class data type json j 2 = { {"pi", 3. 141}, {"happy", true}, {"name", "Niels"}, {"nothing", nullptr}, {"answer", { {"everything", 42} }}, {"list", {1, 0, 2}}, {"object", { {"currency", "USD"}, {"value", 42. 99} }} }; json j 3 = "{ "happy": true, "pi": 3. 141 }"_json; // serialize
- Slides: 11