Skip to content

Initial version of base64 encoding #300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 15, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove padding_length() from the encoding state; the count of padding…
… characters becomes private
  • Loading branch information
prantlf committed Sep 14, 2013
commit efd0c2789aca118f7b7fb74a451372188f428da6
2 changes: 1 addition & 1 deletion boost/network/utils/base64/encode-io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct state : public boost::network::utils::base64::state<Value> {

// allow only the construction with an output stream (strict RAII)
state();
state(state<Char, Value> const & source);
state(state<Char, Value> const &);

std::basic_ostream<Char> & output;

Expand Down
15 changes: 4 additions & 11 deletions boost/network/utils/base64/encode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ namespace utils {
// struct state<Value> {
// bool empty () const;
// void clear();
// unsigned short padding_length() const;
// }
//
// OutputIterator encode(InputIterator begin, InputIterator end,
Expand Down Expand Up @@ -85,12 +84,6 @@ struct state {
last_encoded_value = 0;
}

unsigned short padding_length() const {
// the fewer octets from the triplet processed, the more characters
// needed as padding padding - that is why the complement here
return triplet_index ? 3 - triplet_index : 0;
}

protected:
// number of the octet in the incomplete quantum, which has been
// processed the last time; 0 means that the previous quantum was
Expand Down Expand Up @@ -414,12 +407,12 @@ std::basic_string<Char> encode(char const * value) {
return result;
}

// the function overloads for string literals encode the input without
// The function overloads for string literals encode the input without
// the terminating zero, which is usually expected, because the trailing
// zero byte is not considered a part of the string value; the overloads
// foran input range would wrap the string literal by Boost.Range and
// encodethe full memory occupated by the string literal - including the
// unwanted last zero byte
// for an input range would wrap the string literal by Boost.Range and
// encode the full memory occupated by the string literal - including the
// unwanted last zero byte.

} // namespace base64

Expand Down