Fixed string+int issues in headers

This commit is contained in:
Quentin Fiard 2014-02-27 21:26:22 +00:00
parent 642efc8d00
commit cc9355c038
2 changed files with 8 additions and 4 deletions

View file

@ -8,6 +8,7 @@
#include <SAX/Attributes.hpp>
#include <stdexcept>
#include <deque>
#include <sstream>
namespace Arabica
{
@ -546,9 +547,9 @@ private:
void badIndex(unsigned int index)
{
// sort out
std::string msg =
"Attempt to modify attribute at illegal index: " + index;
throw std::out_of_range(msg);
std::stringstream msg;
msg << "Attempt to modify attribute at illegal index: " << index;
throw std::out_of_range(msg.str());
}
class AttributeNamed

View file

@ -1,6 +1,7 @@
#ifndef ARABICA_SAX_TAGGLE_HTML_SCANNER_HPP
#define ARABICA_SAX_TAGGLE_HTML_SCANNER_HPP
#include <sstream>
#include <SAX/SAXException.hpp>
#include <SAX/Locator.hpp>
#include <XML/XMLCharacterClasses.hpp>
@ -473,7 +474,9 @@ public:
outputBuffer_.clear();
break;
default:
throw std::runtime_error("Can't process state " + action);
throw std::runtime_error(
"Can't process state " + static_cast<std::stringstream const&>(
std::stringstream() << action).str());
} // switch ...
state_ = nextState_;
} // while (state_ != S_DONE)