summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2013-07-06 15:05:45 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2013-07-06 15:05:45 +0200
commit688aa1eb357b41e26d0a12f0d34dca426a50feb7 (patch)
treecdaf903460749a710949ef5bf119159f1bc27888
parent0cde479e62ce80a8a619f2e11b77f7f64b970802 (diff)
Proper fix for older boost and remove_whitespace
-rw-r--r--src/lib/libvisio_utils.cpp7
-rw-r--r--src/lib/libvisio_utils.h2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/libvisio_utils.cpp b/src/lib/libvisio_utils.cpp
index 42e2adc..88bd2b8 100644
--- a/src/lib/libvisio_utils.cpp
+++ b/src/lib/libvisio_utils.cpp
@@ -123,14 +123,15 @@ double libvisio::readDouble(WPXInputStream *input)
return tmpUnion.d;
}
-void libvisio::appendFromBase64(WPXBinaryData &data, const unsigned char *base64String, size_t base64StringLength)
+void libvisio::appendFromBase64(WPXBinaryData &data, const unsigned char *base64Data, size_t base64DataLength)
{
+ std::string base64String((const char*)base64Data, base64DataLength);
typedef boost::archive::iterators::transform_width<
boost::archive::iterators::binary_from_base64<
- boost::archive::iterators::remove_whitespace< const char * > >, 8, 6 > base64_decoder;
+ boost::archive::iterators::remove_whitespace< std::string::const_iterator > >, 8, 6 > base64_decoder;
std::vector<unsigned char> buffer;
- std::copy(base64_decoder(base64String), base64_decoder(base64String + base64StringLength), std::back_inserter(buffer));
+ std::copy(base64_decoder(base64String.begin()), base64_decoder(base64String.end()), std::back_inserter(buffer));
if (!buffer.empty())
data.append(&buffer[0], buffer.size());
diff --git a/src/lib/libvisio_utils.h b/src/lib/libvisio_utils.h
index 2298907..3cd6afa 100644
--- a/src/lib/libvisio_utils.h
+++ b/src/lib/libvisio_utils.h
@@ -98,7 +98,7 @@ uint64_t readU64(WPXInputStream *input);
double readDouble(WPXInputStream *input);
-void appendFromBase64(WPXBinaryData &data, const unsigned char *base64String, size_t base64StringLength);
+void appendFromBase64(WPXBinaryData &data, const unsigned char *base64Data, size_t base64DataLength);
const ::WPXString getColourString(const Colour &c);