Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "base/strings/string_number_conversions.h" | 5 #include "base/strings/string_number_conversions.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <wctype.h> | 10 #include <wctype.h> |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 493 return IteratorRangeToNumber<HexIteratorRangeToIntTraits>::Invoke( | 493 return IteratorRangeToNumber<HexIteratorRangeToIntTraits>::Invoke( |
| 494 input.begin(), input.end(), output); | 494 input.begin(), input.end(), output); |
| 495 } | 495 } |
| 496 | 496 |
| 497 bool HexStringToInt64(const StringPiece& input, int64* output) { | 497 bool HexStringToInt64(const StringPiece& input, int64* output) { |
| 498 return IteratorRangeToNumber<HexIteratorRangeToInt64Traits>::Invoke( | 498 return IteratorRangeToNumber<HexIteratorRangeToInt64Traits>::Invoke( |
| 499 input.begin(), input.end(), output); | 499 input.begin(), input.end(), output); |
| 500 } | 500 } |
| 501 | 501 |
| 502 bool HexStringToUInt64(const StringPiece& input, uint64* output) { | 502 bool HexStringToUInt64(const StringPiece& input, uint64* output) { |
| 503 if (input[0] == '-') { | |
| 504 return false; | |
|
brettw
2013/04/24 05:42:05
The header file defines that the best effort resul
Mostyn Bramley-Moore
2013/04/24 08:19:20
The template code only seems to check for valid ne
| |
| 505 } | |
| 503 return IteratorRangeToNumber<HexIteratorRangeToUInt64Traits>::Invoke( | 506 return IteratorRangeToNumber<HexIteratorRangeToUInt64Traits>::Invoke( |
| 504 input.begin(), input.end(), output); | 507 input.begin(), input.end(), output); |
| 505 } | 508 } |
| 506 | 509 |
| 507 bool HexStringToBytes(const std::string& input, std::vector<uint8>* output) { | 510 bool HexStringToBytes(const std::string& input, std::vector<uint8>* output) { |
| 508 return HexStringToBytesT(input, output); | 511 return HexStringToBytesT(input, output); |
| 509 } | 512 } |
| 510 | 513 |
| 511 } // namespace base | 514 } // namespace base |
| OLD | NEW |