Export of internal Abseil changes.
-- f4bb8afa9376b4120f56f3beff7b07260da4a5c2 by CJ Johnson <johnsoncj@google.com>: Add user to Github list PiperOrigin-RevId: 209630262 GitOrigin-RevId: f4bb8afa9376b4120f56f3beff7b07260da4a5c2 Change-Id: I3fedf35011d805ee4a20b92e073b43523b47d15b
This commit is contained in:
parent
fefc83638f
commit
bed5bd6e18
54 changed files with 302 additions and 302 deletions
|
|
@ -17,7 +17,7 @@
|
|||
// File: escaping.h
|
||||
// -----------------------------------------------------------------------------
|
||||
//
|
||||
// This header file contains std::string utilities involved in escaping and
|
||||
// This header file contains string utilities involved in escaping and
|
||||
// unescaping strings in various ways.
|
||||
//
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ namespace absl {
|
|||
|
||||
// CUnescape()
|
||||
//
|
||||
// Unescapes a `source` std::string and copies it into `dest`, rewriting C-style
|
||||
// Unescapes a `source` string and copies it into `dest`, rewriting C-style
|
||||
// escape sequences (http://en.cppreference.com/w/cpp/language/escape) into
|
||||
// their proper code point equivalents, returning `true` if successful.
|
||||
//
|
||||
|
|
@ -78,7 +78,7 @@ inline bool CUnescape(absl::string_view source, std::string* dest) {
|
|||
|
||||
// CEscape()
|
||||
//
|
||||
// Escapes a 'src' std::string using C-style escapes sequences
|
||||
// Escapes a 'src' string using C-style escapes sequences
|
||||
// (http://en.cppreference.com/w/cpp/language/escape), escaping other
|
||||
// non-printable/non-whitespace bytes as octal sequences (e.g. "\377").
|
||||
//
|
||||
|
|
@ -91,7 +91,7 @@ std::string CEscape(absl::string_view src);
|
|||
|
||||
// CHexEscape()
|
||||
//
|
||||
// Escapes a 'src' std::string using C-style escape sequences, escaping
|
||||
// Escapes a 'src' string using C-style escape sequences, escaping
|
||||
// other non-printable/non-whitespace bytes as hexadecimal sequences (e.g.
|
||||
// "\xFF").
|
||||
//
|
||||
|
|
@ -104,7 +104,7 @@ std::string CHexEscape(absl::string_view src);
|
|||
|
||||
// Utf8SafeCEscape()
|
||||
//
|
||||
// Escapes a 'src' std::string using C-style escape sequences, escaping bytes as
|
||||
// Escapes a 'src' string using C-style escape sequences, escaping bytes as
|
||||
// octal sequences, and passing through UTF-8 characters without conversion.
|
||||
// I.e., when encountering any bytes with their high bit set, this function
|
||||
// will not escape those values, whether or not they are valid UTF-8.
|
||||
|
|
@ -112,47 +112,47 @@ std::string Utf8SafeCEscape(absl::string_view src);
|
|||
|
||||
// Utf8SafeCHexEscape()
|
||||
//
|
||||
// Escapes a 'src' std::string using C-style escape sequences, escaping bytes as
|
||||
// Escapes a 'src' string using C-style escape sequences, escaping bytes as
|
||||
// hexadecimal sequences, and passing through UTF-8 characters without
|
||||
// conversion.
|
||||
std::string Utf8SafeCHexEscape(absl::string_view src);
|
||||
|
||||
// Base64Unescape()
|
||||
//
|
||||
// Converts a `src` std::string encoded in Base64 to its binary equivalent, writing
|
||||
// Converts a `src` string encoded in Base64 to its binary equivalent, writing
|
||||
// it to a `dest` buffer, returning `true` on success. If `src` contains invalid
|
||||
// characters, `dest` is cleared and returns `false`.
|
||||
bool Base64Unescape(absl::string_view src, std::string* dest);
|
||||
|
||||
// WebSafeBase64Unescape()
|
||||
//
|
||||
// Converts a `src` std::string encoded in Base64 to its binary equivalent, writing
|
||||
// Converts a `src` string encoded in Base64 to its binary equivalent, writing
|
||||
// it to a `dest` buffer, but using '-' instead of '+', and '_' instead of '/'.
|
||||
// If `src` contains invalid characters, `dest` is cleared and returns `false`.
|
||||
bool WebSafeBase64Unescape(absl::string_view src, std::string* dest);
|
||||
|
||||
// Base64Escape()
|
||||
//
|
||||
// Encodes a `src` std::string into a `dest` buffer using base64 encoding, with
|
||||
// Encodes a `src` string into a `dest` buffer using base64 encoding, with
|
||||
// padding characters. This function conforms with RFC 4648 section 4 (base64).
|
||||
void Base64Escape(absl::string_view src, std::string* dest);
|
||||
|
||||
// WebSafeBase64Escape()
|
||||
//
|
||||
// Encodes a `src` std::string into a `dest` buffer using '-' instead of '+' and
|
||||
// Encodes a `src` string into a `dest` buffer using '-' instead of '+' and
|
||||
// '_' instead of '/', and without padding. This function conforms with RFC 4648
|
||||
// section 5 (base64url).
|
||||
void WebSafeBase64Escape(absl::string_view src, std::string* dest);
|
||||
|
||||
// HexStringToBytes()
|
||||
//
|
||||
// Converts an ASCII hex std::string into bytes, returning binary data of length
|
||||
// Converts an ASCII hex string into bytes, returning binary data of length
|
||||
// `from.size()/2`.
|
||||
std::string HexStringToBytes(absl::string_view from);
|
||||
|
||||
// BytesToHexString()
|
||||
//
|
||||
// Converts binary data into an ASCII text std::string, returning a std::string of size
|
||||
// Converts binary data into an ASCII text string, returning a string of size
|
||||
// `2*from.size()`.
|
||||
std::string BytesToHexString(absl::string_view from);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue