Remove the encoder/decoder dependecy from Hint

This commit is contained in:
Patrick Niklaus
2016-03-08 23:46:14 +01:00
parent 1109b8de16
commit 0be7ce2c0f
3 changed files with 24 additions and 19 deletions
+20
View File
@@ -0,0 +1,20 @@
#include "engine/hint.hpp"
#include "engine/object_encoder.hpp"
#include <boost/assert.hpp>
namespace osrm
{
namespace engine
{
std::string Hint::ToBase64() const { return encodeBase64(*this); }
Hint Hint::FromBase64(const std::string &base64Hint)
{
BOOST_ASSERT_MSG(base64Hint.size() == ENCODED_HINT_SIZE, "Hint has invalid size");
auto decoded = decodeBase64<Hint>(base64Hint);
return decoded;
}
}
}