diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-07-11 10:27:44 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-07-11 10:27:44 +0200 |
commit | 128c47a9137baf121f39d63e3f89b699abc81d93 (patch) | |
tree | 55ff1f6193d01a2f33dec7c58af97fce4185542e | |
parent | 0c2293c7b1e0793f61a396d5bb3e9161f965b8e3 (diff) |
Trying to use iterators without wrapping the data
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | src/lib/libvisio_utils.cpp | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 8af2f10..77bbe05 100644 --- a/configure.ac +++ b/configure.ac @@ -109,11 +109,12 @@ AC_SUBST(ZLIB_LIBS) AC_CHECK_HEADERS( boost/algorithm/string.hpp \ - boost/optional.hpp \ - boost/spirit/include/classic.hpp \ boost/archive/iterators/binary_from_base64.hpp \ boost/archive/iterators/remove_whitespace.hpp \ - boost/archive/iterators/transform_width.hpp, + boost/archive/iterators/transform_width.hpp \ + boost/optional.hpp \ + boost/range/iterator_range.hpp \ + boost/spirit/include/classic.hpp, [], [AC_MSG_ERROR(Required boost headers not found. install boost >= 1.36)], [] diff --git a/src/lib/libvisio_utils.cpp b/src/lib/libvisio_utils.cpp index ae3f237..9ad520c 100644 --- a/src/lib/libvisio_utils.cpp +++ b/src/lib/libvisio_utils.cpp @@ -35,6 +35,7 @@ #include <boost/archive/iterators/binary_from_base64.hpp> #include <boost/archive/iterators/remove_whitespace.hpp> #include <boost/archive/iterators/transform_width.hpp> +#include <boost/range/iterator_range.hpp> uint8_t libvisio::readU8(WPXInputStream *input) { @@ -125,7 +126,7 @@ double libvisio::readDouble(WPXInputStream *input) void libvisio::appendFromBase64(WPXBinaryData &data, const unsigned char *base64Data, size_t base64DataLength) { - std::string base64String((const char *)base64Data, base64DataLength); + boost::iterator_range<const char *> base64String((const char *)base64Data, (const char *)base64Data + base64DataLength); typedef boost::archive::iterators::transform_width< boost::archive::iterators::binary_from_base64< boost::archive::iterators::remove_whitespace< std::string::const_iterator > >, 8, 6 > base64_decoder; |