Skip to content

Instantly share code, notes, and snippets.

@nico159
Created August 20, 2013 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nico159/6280040 to your computer and use it in GitHub Desktop.
Save nico159/6280040 to your computer and use it in GitHub Desktop.
#ifndef BOOST_NETWORK_UTILS_BASE64_HPP_20130820
#define BOOST_NETWORK_UTILS_BASE64_HPP_20130820
// Copyright 2010 Dean Michael Berris.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
namespace boost { namespace network { namespace utils {
struct base64 {
/** decodes base64-encoded strings
*
* @param input base64 encoded string
* @param output decoded string ( may include non-text chars)
* @return true if successful, false if input string contains non-base64 symbols
*/
template <typename InputIt, typename OutputIt>
static InputIt encode(InputIt begin, InputIt end, OutputIt destination);
/** encodes strings using base64
*
* @param input arbitrary string ( may include non-text chars)
* @param output base64 encoded string
* @return true if successful
*/
template <typename InputIt, typename OutputIt>
static InputIt decode(InputIt begin, InputIt end, OutputIt destination);
};
} /* utils */
} /* network */
} /* boost */
// import implementation file
#include <boost/network/utils/impl/base64.ipp>
#endif /* BOOST_NETWORK_UTILS_BASE64_HPP_20130820 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment