Mercurial > code
changeset 342:b32a0d29d97a
Base64: new documentation
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 30 Mar 2015 10:49:26 +0200 |
parents | 83ef77841ff1 |
children | 5c74a623888c |
files | C++/doc/Base64/Home.md C++/doc/Base64/class/Base64.md C++/doc/Base64/class/Base64/decode.md C++/doc/Base64/class/Base64/encode.md C++/doc/Base64/class/Base64/lookup.md C++/doc/Base64/class/Base64/rlookup.md CMakeLists.txt |
diffstat | 7 files changed, 176 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C++/doc/Base64/Home.md Mon Mar 30 10:49:26 2015 +0200 @@ -0,0 +1,9 @@ +# Base64 + +Module for encoding/decoding Base64 data. + +## API Reference + +### Classes + +- [Base64](class/Base64.md) \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C++/doc/Base64/class/Base64.md Mon Mar 30 10:49:26 2015 +0200 @@ -0,0 +1,16 @@ +# Base64 + +The base64 class. Allows you to encode strings and any stream that provide input iterators. + +## Class + +````cpp +class Base64; +```` + +### Public member functions + +- [lookup (static)](Base64/lookup.md) +- [rlookup (static)](Base64/rlookup.md) +- [encode (static)](Base64/encode.md) +- [decode (static)](Base64/decode.md) \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C++/doc/Base64/class/Base64/decode.md Mon Mar 30 10:49:26 2015 +0200 @@ -0,0 +1,48 @@ +# decode (static template) + +Decode any stream that supports input iterators. + +## Function + +### SYNOPSIS + +````cpp +template <typename InputIt, typename OutputIt> +static OutputIt decode(InputIt input, InputIt end, OutputIt output); +```` + +### ARGUMENTS + +- input, the beginning of the stream ([InputIterator](http://en.cppreference.com/w/cpp/concept/InputIterator)) +- end, the end of the stream ([InputIterator](http://en.cppreference.com/w/cpp/concept/InputIterator)) +- output, the output stream ([OutputIterator](http://en.cppreference.com/w/cpp/concept/OutputIterator)) + +### RETURNS + +output. + +### THROWS + +- [std::invalid_argument](http://en.cppreference.com/w/cpp/error/invalid_argument) on invalid base64 string + +# decode (static) + +## Function + +### SYNOPSIS + +````cpp +static std::string decode(const std::string &input); +```` + +### ARGUMENTS + +- input, the input string + +### RETURNS + +The original string. + +### THROWS + +- [std::invalid_argument](http://en.cppreference.com/w/cpp/error/invalid_argument) on invalid base64 string \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C++/doc/Base64/class/Base64/encode.md Mon Mar 30 10:49:26 2015 +0200 @@ -0,0 +1,42 @@ +# encode (static template) + +Encode any stream that supports input iterators. + +## Function + +### SYNOPSIS + +````cpp +template <typename InputIt, typename OutputIt> +static OutputIt encode(InputIt input, InputIt end, OutputIt output); +```` + +### ARGUMENTS + +- input, the beginning of the stream ([InputIterator](http://en.cppreference.com/w/cpp/concept/InputIterator)) +- end, the end of the stream ([InputIterator](http://en.cppreference.com/w/cpp/concept/InputIterator)) +- output, the output stream ([OutputIterator](http://en.cppreference.com/w/cpp/concept/OutputIterator)) + +### RETURNS + +output. + +# encode (static) + +Encode a std::string. + +## Function + +### SYNOPSIS + +````cpp +static std::string encode(const std::string &input); +```` + +### ARGUMENTS + +- input, the input string + +### RETURNS + +The base64 encoded string. \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C++/doc/Base64/class/Base64/lookup.md Mon Mar 30 10:49:26 2015 +0200 @@ -0,0 +1,25 @@ +# lookup (static) + +Convert a 6-bit integer to the base64 encoded character. + +## Function + +### SYNOPSIS + +````cpp +static char lookup(int value) noexcept; +```` + +### ARGUMENTS + +- value, the 6-bit character + +### RETURNS + +The base64 encoding value + +### EXAMPLES + +````cpp +auto bchar = Base64::lookup(0b000010); // bchar == 'C' +```` \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/C++/doc/Base64/class/Base64/rlookup.md Mon Mar 30 10:49:26 2015 +0200 @@ -0,0 +1,29 @@ +# rlookup (static) + +Convert a base64 character to the corresponding value. + +## Function + +### SYNOPSIS + +````cpp +static int rlookup(char ch); +```` + +### ARGUMENTS + +- ch, the base64 character + +### RETURNS + +The value. + +### THROWS + +- [std::invalid_argument](http://en.cppreference.com/w/cpp/error/invalid_argument) if ch is not a valid argument + +### EXAMPLES + +````cpp +auto v = Base64::decode('G'); // v = 0b000110 +```` \ No newline at end of file
--- a/CMakeLists.txt Mon Mar 30 09:21:01 2015 +0200 +++ b/CMakeLists.txt Mon Mar 30 10:49:26 2015 +0200 @@ -128,6 +128,13 @@ SOURCES ${code_SOURCE_DIR}/C++/modules/Base64/Base64.cpp ${code_SOURCE_DIR}/C++/modules/Base64/Base64.h + DOCS + ${code_SOURCE_DIR}/C++/doc/Base64/Home.md + ${code_SOURCE_DIR}/C++/doc/Base64/class/Base64.md + ${code_SOURCE_DIR}/C++/doc/Base64/class/Base64/decode.md + ${code_SOURCE_DIR}/C++/doc/Base64/class/Base64/encode.md + ${code_SOURCE_DIR}/C++/doc/Base64/class/Base64/lookup.md + ${code_SOURCE_DIR}/C++/doc/Base64/class/Base64/rlookup.md ) # ---------------------------------------------------------