Clone
ixen <ixen@copyhandler.com>
committed
on 17 Jun 20
Fixed warning-as-error issue with newest boost and VS versions.
ch-1.40 + 2 more
src/ch/UpdateResponse.cpp (+3 -0)
1 1 // ============================================================================
2 2 //  Copyright (C) 2001-2015 by Jozef Starosczyk
3 3 //  ixen@copyhandler.com
4 4 //
5 5 //  This program is free software; you can redistribute it and/or modify
6 6 //  it under the terms of the GNU Library General Public License
7 7 //  (version 2) as published by the Free Software Foundation;
8 8 //
9 9 //  This program is distributed in the hope that it will be useful,
10 10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 12 //  GNU General Public License for more details.
13 13 //
14 14 //  You should have received a copy of the GNU Library General Public
15 15 //  License along with this program; if not, write to the
16 16 //  Free Software Foundation, Inc.,
17 17 //  59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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         // add version information; note that assumption here that we receive version informations
39 42         // sorted by stability (decreasing) - that way we only present the user suggestions to download
40 43         // newest versions with highest stability
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);