From 8925299947affea1812fc93d7e77b493a23c99f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 1 Feb 2019 00:09:07 +0100 Subject: [PATCH] Attempt to fix MSVC compile issue --- lib/importproject.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/importproject.cpp b/lib/importproject.cpp index 08ec3c672..48c42dc50 100644 --- a/lib/importproject.cpp +++ b/lib/importproject.cpp @@ -899,11 +899,16 @@ static const char ToolsElementName[] = "tools"; static const char TagsElementName[] = "tags"; static const char TagElementName[] = "tag"; +static std::string istream_to_string(std::istream &istr) +{ + std::istreambuf_iterator eos; + return std::string(std::istreambuf_iterator(istr), eos); +} bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings *settings) { tinyxml2::XMLDocument doc; - const std::string xmldata(std::istreambuf_iterator(istr), {}); + const std::string xmldata = istream_to_string(istr); if (doc.Parse(xmldata.data(), xmldata.size()) != tinyxml2::XML_SUCCESS) return false; const tinyxml2::XMLElement * const rootnode = doc.FirstChildElement();