Attempt to fix MSVC compile issue
This commit is contained in:
parent
98fc6d1d32
commit
8925299947
|
@ -899,11 +899,16 @@ static const char ToolsElementName[] = "tools";
|
||||||
static const char TagsElementName[] = "tags";
|
static const char TagsElementName[] = "tags";
|
||||||
static const char TagElementName[] = "tag";
|
static const char TagElementName[] = "tag";
|
||||||
|
|
||||||
|
static std::string istream_to_string(std::istream &istr)
|
||||||
|
{
|
||||||
|
std::istreambuf_iterator<char> eos;
|
||||||
|
return std::string(std::istreambuf_iterator<char>(istr), eos);
|
||||||
|
}
|
||||||
|
|
||||||
bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings *settings)
|
bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings *settings)
|
||||||
{
|
{
|
||||||
tinyxml2::XMLDocument doc;
|
tinyxml2::XMLDocument doc;
|
||||||
const std::string xmldata(std::istreambuf_iterator<char>(istr), {});
|
const std::string xmldata = istream_to_string(istr);
|
||||||
if (doc.Parse(xmldata.data(), xmldata.size()) != tinyxml2::XML_SUCCESS)
|
if (doc.Parse(xmldata.data(), xmldata.size()) != tinyxml2::XML_SUCCESS)
|
||||||
return false;
|
return false;
|
||||||
const tinyxml2::XMLElement * const rootnode = doc.FirstChildElement();
|
const tinyxml2::XMLElement * const rootnode = doc.FirstChildElement();
|
||||||
|
|
Loading…
Reference in New Issue