OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_number_conversions.h" | 5 #include "base/string_number_conversions.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <wctype.h> | 9 #include <wctype.h> |
10 | 10 |
11 #include <limits> | 11 #include <limits> |
12 | 12 |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/third_party/dmg_fp/dmg_fp.h" | 14 #include "base/third_party/dmg_fp/dmg_fp.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 | 16 |
17 #if defined(OS_ANDROID) | |
brettw
2011/07/07 16:55:53
I wouldn't put these ctype includes in an android
michaelbai
2011/07/07 18:28:47
Done.
| |
18 #include <ctype.h> | |
19 #endif | |
20 | |
17 namespace base { | 21 namespace base { |
18 | 22 |
19 namespace { | 23 namespace { |
20 | 24 |
21 template <typename STR, typename INT, typename UINT, bool NEG> | 25 template <typename STR, typename INT, typename UINT, bool NEG> |
22 struct IntToStringT { | 26 struct IntToStringT { |
23 // This is to avoid a compiler warning about unary minus on unsigned type. | 27 // This is to avoid a compiler warning about unary minus on unsigned type. |
24 // For example, say you had the following code: | 28 // For example, say you had the following code: |
25 // template <typename INT> | 29 // template <typename INT> |
26 // INT abs(INT value) { return value < 0 ? -value : value; } | 30 // INT abs(INT value) { return value < 0 ? -value : value; } |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
535 end, | 539 end, |
536 output); | 540 output); |
537 } | 541 } |
538 #endif | 542 #endif |
539 | 543 |
540 bool HexStringToBytes(const std::string& input, std::vector<uint8>* output) { | 544 bool HexStringToBytes(const std::string& input, std::vector<uint8>* output) { |
541 return HexStringToBytesT(input, output); | 545 return HexStringToBytesT(input, output); |
542 } | 546 } |
543 | 547 |
544 } // namespace base | 548 } // namespace base |
OLD | NEW |