or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
C++ JSON File
簡單使用指北
Author: tico88612
前置任務
當然是先安裝 MinGW + VSCode 設定
https://blog.yangjerry.tw/2021/09/24/vscode-cpp-2021-part1/
VSCode IntelliSence + GDB
https://blog.yangjerry.tw/2021/09/26/vscode-cpp-2021-part2/
Install
https://github.com/nlohmann/json
https://github.com/nlohmann/json/#integration
前面連結點下去,怕爆.jpg
Visual Studio 就直接去 NuGet 下載套件就可以使用了。
想更簡單一點,直接 simple_include/nlohmann 裡面抓到 json.hpp
就可以
#include "nlohmann/json.hpp"
Demo
Usage
main.cpp
Application
HL7 FHIR Observation Blood Pressure
https://www.hl7.org/fhir/observation-example-bloodpressure.json.html
之後可能就用 QT C++ 的 Function 或 cURL 先下載之類的
這裡只示範怎麼用純 C++ 去讀取
上面的 example 做為 blood-pressure-input.json
C++ 檔案讀取
確認他可以讀取成功,那就來做更進階的讀取。
如果你知道 JavaScript 的 JSON 怎麼讀取,這裡就怎麼讀取。
這裡的 Code 僅且示範怎麼拿取資料,最好還是把這些資料做成 Object Class。
讀取測量時間
讀取測量部位
測量狀況
將多筆數值讀取(包含收縮壓、舒張壓)
Thank you!