| 15 | namespace { |
| 16 | |
| 17 | vector<pair<int, int>> ParsePath(const wstring &path) { |
| 18 | vector<pair<int, int>> points; |
| 19 | wstringstream stream(path); |
| 20 | wstring token; |
| 21 | while (getline(stream, token, L'|')) { |
| 22 | int x = 0; |
| 23 | int y = 0; |
| 24 | if (swscanf_s(token.c_str(), L"%d,%d", &x, &y) == 2) { |
| 25 | points.emplace_back(x, y); |
| 26 | } |
| 27 | } |
| 28 | return points; |
| 29 | } |
| 30 | |
| 31 | struct ScopedHandle { |
| 32 | HANDLE handle = INVALID_HANDLE_VALUE; |