| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_util.h" | 5 #include "base/string_util.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include <ctype.h> | 9 #include <ctype.h> |
| 10 #include <errno.h> | 10 #include <errno.h> |
| (...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 IntToString(value); | 1054 IntToString(value); |
| 1055 } | 1055 } |
| 1056 std::string UintToString(unsigned int value) { | 1056 std::string UintToString(unsigned int value) { |
| 1057 return IntToStringT<std::string, unsigned int, unsigned int, false>:: | 1057 return IntToStringT<std::string, unsigned int, unsigned int, false>:: |
| 1058 IntToString(value); | 1058 IntToString(value); |
| 1059 } | 1059 } |
| 1060 std::wstring UintToWString(unsigned int value) { | 1060 std::wstring UintToWString(unsigned int value) { |
| 1061 return IntToStringT<std::wstring, unsigned int, unsigned int, false>:: | 1061 return IntToStringT<std::wstring, unsigned int, unsigned int, false>:: |
| 1062 IntToString(value); | 1062 IntToString(value); |
| 1063 } | 1063 } |
| 1064 string16 UintToString16(unsigned int value) { |
| 1065 return IntToStringT<string16, unsigned int, unsigned int, false>:: |
| 1066 IntToString(value); |
| 1067 } |
| 1064 std::string Int64ToString(int64 value) { | 1068 std::string Int64ToString(int64 value) { |
| 1065 return IntToStringT<std::string, int64, uint64, true>:: | 1069 return IntToStringT<std::string, int64, uint64, true>:: |
| 1066 IntToString(value); | 1070 IntToString(value); |
| 1067 } | 1071 } |
| 1068 std::wstring Int64ToWString(int64 value) { | 1072 std::wstring Int64ToWString(int64 value) { |
| 1069 return IntToStringT<std::wstring, int64, uint64, true>:: | 1073 return IntToStringT<std::wstring, int64, uint64, true>:: |
| 1070 IntToString(value); | 1074 IntToString(value); |
| 1071 } | 1075 } |
| 1072 std::string Uint64ToString(uint64 value) { | 1076 std::string Uint64ToString(uint64 value) { |
| 1073 return IntToStringT<std::string, uint64, uint64, false>:: | 1077 return IntToStringT<std::string, uint64, uint64, false>:: |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1645 // Each input byte creates two output hex characters. | 1649 // Each input byte creates two output hex characters. |
| 1646 std::string ret(size * 2, '\0'); | 1650 std::string ret(size * 2, '\0'); |
| 1647 | 1651 |
| 1648 for (size_t i = 0; i < size; ++i) { | 1652 for (size_t i = 0; i < size; ++i) { |
| 1649 char b = reinterpret_cast<const char*>(bytes)[i]; | 1653 char b = reinterpret_cast<const char*>(bytes)[i]; |
| 1650 ret[(i * 2)] = kHexChars[(b >> 4) & 0xf]; | 1654 ret[(i * 2)] = kHexChars[(b >> 4) & 0xf]; |
| 1651 ret[(i * 2) + 1] = kHexChars[b & 0xf]; | 1655 ret[(i * 2) + 1] = kHexChars[b & 0xf]; |
| 1652 } | 1656 } |
| 1653 return ret; | 1657 return ret; |
| 1654 } | 1658 } |
| OLD | NEW |