| |
1 |
1 |
|
| |
2 |
2 |
|
| |
3 |
3 |
|
| |
4 |
4 |
|
| |
5 |
5 |
|
| |
6 |
6 |
|
| |
7 |
7 |
|
| |
8 |
8 |
|
| |
9 |
9 |
|
| |
10 |
10 |
|
| |
11 |
11 |
|
| |
12 |
12 |
|
| |
13 |
13 |
|
| |
14 |
14 |
|
| |
15 |
15 |
|
| |
16 |
16 |
|
| |
17 |
17 |
|
| |
18 |
18 |
|
| |
19 |
19 |
#include "stdafx.h" |
| |
20 |
20 |
#include "UpdateResponse.h" |
| |
|
21 |
#pragma warning(push) |
| |
|
22 |
#pragma warning(disable: 4244) |
| |
21 |
23 |
#include <codecvt> |
| |
22 |
24 |
#include <locale> |
| |
23 |
25 |
#include <boost/property_tree/xml_parser.hpp> |
| |
24 |
26 |
#include <boost/property_tree/ptree.hpp> |
| |
25 |
27 |
#include <boost/algorithm/string.hpp> |
| |
26 |
28 |
#include <boost/date_time/gregorian/gregorian.hpp> |
| |
27 |
29 |
#include <sstream> |
| |
|
30 |
#pragma warning(pop) |
| |
28 |
31 |
|
| |
29 |
32 |
UpdateResponse::UpdateResponse(std::stringstream& tDataStream) |
| |
30 |
33 |
{ |
| |
31 |
34 |
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> conversion; |
| |
32 |
35 |
std::wstringstream wssData(conversion.from_bytes(tDataStream.str())); |
| |
33 |
36 |
|
| |
34 |
37 |
using namespace boost::property_tree; |
| |
35 |
38 |
wiptree pt; |
| |
36 |
39 |
read_xml(wssData, pt); |
| |
37 |
40 |
|
| |
38 |
41 |
|
| |
39 |
42 |
|
| |
40 |
43 |
|
| |
41 |
44 |
unsigned long long ullLastVersionNumber = 0; |
| |
42 |
45 |
for(const wiptree::value_type& node : pt.get_child(L"UpdateInfo")) |
| |
43 |
46 |
{ |
| |
44 |
47 |
try |
| |
45 |
48 |
{ |
| |
46 |
49 |
UpdateVersionInfo::EVersionType eType = ParseVersionName(node.first); |
| |
47 |
50 |
UpdateVersionInfo vi = ParseVersionInfo(node.second); |