Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Side by Side Diff: base/string_number_conversions.h

Issue 11293078: Integrating Online Wallet into Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes from Raman's code review Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/string_number_conversions.cc » ('j') | chrome/browser/autofill/wallet/cart.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_STRING_NUMBER_CONVERSIONS_H_ 5 #ifndef BASE_STRING_NUMBER_CONVERSIONS_H_
6 #define BASE_STRING_NUMBER_CONVERSIONS_H_ 6 #define BASE_STRING_NUMBER_CONVERSIONS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // string will be in upper case. This function does not check if |size| is 88 // string will be in upper case. This function does not check if |size| is
89 // within reasonable limits since it's written with trusted data in mind. If 89 // within reasonable limits since it's written with trusted data in mind. If
90 // you suspect that the data you want to format might be large, the absolute 90 // you suspect that the data you want to format might be large, the absolute
91 // max size for |size| should be is 91 // max size for |size| should be is
92 // std::numeric_limits<size_t>::max() / 2 92 // std::numeric_limits<size_t>::max() / 2
93 BASE_EXPORT std::string HexEncode(const void* bytes, size_t size); 93 BASE_EXPORT std::string HexEncode(const void* bytes, size_t size);
94 94
95 // Best effort conversion, see StringToInt above for restrictions. 95 // Best effort conversion, see StringToInt above for restrictions.
96 BASE_EXPORT bool HexStringToInt(const StringPiece& input, int* output); 96 BASE_EXPORT bool HexStringToInt(const StringPiece& input, int* output);
97 97
98 BASE_EXPORT bool HexStringToInt64(const StringPiece& input, int64* output);
Albert Bodenhamer 2012/11/28 23:50:56 You should probably add a new test in base/string_
99
98 // Similar to the previous functions, except that output is a vector of bytes. 100 // Similar to the previous functions, except that output is a vector of bytes.
99 // |*output| will contain as many bytes as were successfully parsed prior to the 101 // |*output| will contain as many bytes as were successfully parsed prior to the
100 // error. There is no overflow, but input.size() must be evenly divisible by 2. 102 // error. There is no overflow, but input.size() must be evenly divisible by 2.
101 // Leading 0x or +/- are not allowed. 103 // Leading 0x or +/- are not allowed.
102 BASE_EXPORT bool HexStringToBytes(const std::string& input, 104 BASE_EXPORT bool HexStringToBytes(const std::string& input,
103 std::vector<uint8>* output); 105 std::vector<uint8>* output);
104 106
105 } // namespace base 107 } // namespace base
106 108
107 #endif // BASE_STRING_NUMBER_CONVERSIONS_H_ 109 #endif // BASE_STRING_NUMBER_CONVERSIONS_H_
Albert Bodenhamer 2012/11/28 23:50:56 Looks like a whitespace change.
ahutter 2012/11/29 20:52:38 Yeah, the .vimrc file Google provides is doing som
108
OLDNEW
« no previous file with comments | « no previous file | base/string_number_conversions.cc » ('j') | chrome/browser/autofill/wallet/cart.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698