Fixed string+int issues in headers

This commit is contained in:
Quentin Fiard 2014-02-27 21:26:22 +00:00
parent 9e0fdfdfdc
commit 5cfbe17a66
No known key found for this signature in database
GPG key ID: 9509737EA51D626B
2 changed files with 8 additions and 4 deletions

View file

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

View file

@ -1,6 +1,7 @@
#ifndef ARABICA_SAX_TAGGLE_HTML_SCANNER_HPP #ifndef ARABICA_SAX_TAGGLE_HTML_SCANNER_HPP
#define ARABICA_SAX_TAGGLE_HTML_SCANNER_HPP #define ARABICA_SAX_TAGGLE_HTML_SCANNER_HPP
#include <sstream>
#include <SAX/SAXException.hpp> #include <SAX/SAXException.hpp>
#include <SAX/Locator.hpp> #include <SAX/Locator.hpp>
#include <XML/XMLCharacterClasses.hpp> #include <XML/XMLCharacterClasses.hpp>
@ -473,7 +474,9 @@ public:
outputBuffer_.clear(); outputBuffer_.clear();
break; break;
default: 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 ... } // switch ...
state_ = nextState_; state_ = nextState_;
} // while (state_ != S_DONE) } // while (state_ != S_DONE)