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> |
11 #include <math.h> | 11 #include <math.h> |
12 #include <stdarg.h> | 12 #include <stdarg.h> |
13 #include <stdio.h> | 13 #include <stdio.h> |
14 #include <stdlib.h> | 14 #include <stdlib.h> |
15 #include <string.h> | 15 #include <string.h> |
16 #include <time.h> | 16 #include <time.h> |
17 #include <wchar.h> | 17 #include <wchar.h> |
18 #include <wctype.h> | 18 #include <wctype.h> |
19 | 19 |
20 #include <algorithm> | 20 #include <algorithm> |
21 #include <vector> | 21 #include <vector> |
22 | 22 |
23 #include "base/basictypes.h" | 23 #include "base/basictypes.h" |
24 #include "base/logging.h" | 24 #include "base/logging.h" |
25 #include "base/singleton.h" | 25 #include "base/singleton.h" |
26 #include "third_party/dmg_fp/dmg_fp.h" | 26 #include "base/third_party/dmg_fp/dmg_fp.h" |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 // Hack to convert any char-like type to its unsigned counterpart. | 30 // Hack to convert any char-like type to its unsigned counterpart. |
31 // For example, it will convert char, signed char and unsigned char to unsigned | 31 // For example, it will convert char, signed char and unsigned char to unsigned |
32 // char. | 32 // char. |
33 template<typename T> | 33 template<typename T> |
34 struct ToUnsigned { | 34 struct ToUnsigned { |
35 typedef T Unsigned; | 35 typedef T Unsigned; |
36 }; | 36 }; |
(...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 int rstr_len = (max_len - 3) / 2; | 1547 int rstr_len = (max_len - 3) / 2; |
1548 int lstr_len = rstr_len + ((max_len - 3) % 2); | 1548 int lstr_len = rstr_len + ((max_len - 3) % 2); |
1549 output->assign(input.substr(0, lstr_len) + L"..." + | 1549 output->assign(input.substr(0, lstr_len) + L"..." + |
1550 input.substr(input.length() - rstr_len)); | 1550 input.substr(input.length() - rstr_len)); |
1551 break; | 1551 break; |
1552 } | 1552 } |
1553 } | 1553 } |
1554 | 1554 |
1555 return true; | 1555 return true; |
1556 } | 1556 } |
OLD | NEW |