Skip to content
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

An encoder for base 64 #2028

Merged
merged 6 commits into from
Dec 16, 2018
Merged

An encoder for base 64 #2028

merged 6 commits into from
Dec 16, 2018

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Dec 15, 2018

No description provided.

base/base64.hpp Outdated Show resolved Hide resolved
void principia::base::internal_base64::Base64Encoder<null_terminated>::Encode(
Array<std::uint8_t const> input,
Array<char> output) {
std::string_view const input_view(reinterpret_cast<const char*>(input.data),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have string_view on mac?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non lo so. There is an absl::string_view. We'll switch to that if Linux/macOS doesn't have the std version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can always summon the most boring kind of UB by

#if OS_MACOSX
namespace std {
using absl::string_view;
}  // namespace std
#endif

base/base64_body.hpp Outdated Show resolved Hide resolved
base/base32768.hpp Outdated Show resolved Hide resolved
@@ -15,19 +15,19 @@ namespace internal_base32768 {
template<bool null_terminated>
class Base32768Encoder : public Encoder<char16_t, null_terminated> {
public:
void Encode(Array<std::uint8_t const> input,
Array<char16_t> output) override;
inline void Encode(Array<std::uint8_t const> input,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant inline, this is templatized.

Same elsewhere.

Sorry, something went wrong.

@eggrobin eggrobin added the LGTM label Dec 15, 2018
@pleroy pleroy merged commit dda9bf9 into mockingbirdnest:master Dec 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants