OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_BASE64URL_H_ | 5 #ifndef BASE_BASE64URL_H_ |
6 #define BASE_BASE64URL_H_ | 6 #define BASE_BASE64URL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" |
12 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 | 16 |
16 enum class Base64UrlEncodePolicy { | 17 enum class Base64UrlEncodePolicy { |
17 // Include the trailing padding in the output, when necessary. | 18 // Include the trailing padding in the output, when necessary. |
18 INCLUDE_PADDING, | 19 INCLUDE_PADDING, |
19 | 20 |
20 // Remove the trailing padding from the output. | 21 // Remove the trailing padding from the output. |
21 OMIT_PADDING | 22 OMIT_PADDING |
(...skipping 24 matching lines...) Expand all Loading... |
46 // | 47 // |
47 // The |policy| defines whether padding will be required, ignored or disallowed | 48 // The |policy| defines whether padding will be required, ignored or disallowed |
48 // altogether. |input| and |*output| may reference the same storage. | 49 // altogether. |input| and |*output| may reference the same storage. |
49 BASE_EXPORT bool Base64UrlDecode(const StringPiece& input, | 50 BASE_EXPORT bool Base64UrlDecode(const StringPiece& input, |
50 Base64UrlDecodePolicy policy, | 51 Base64UrlDecodePolicy policy, |
51 std::string* output) WARN_UNUSED_RESULT; | 52 std::string* output) WARN_UNUSED_RESULT; |
52 | 53 |
53 } // namespace base | 54 } // namespace base |
54 | 55 |
55 #endif // BASE_BASE64URL_H_ | 56 #endif // BASE_BASE64URL_H_ |
OLD | NEW |