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/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/memory/singleton.h" | 25 #include "base/memory/singleton.h" |
26 #include "base/strings/utf_string_conversion_utils.h" | 26 #include "base/strings/utf_string_conversion_utils.h" |
27 #include "base/utf_string_conversions.h" | 27 #include "base/strings/utf_string_conversions.h" |
28 #include "base/third_party/icu/icu_utf.h" | 28 #include "base/third_party/icu/icu_utf.h" |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 // Force the singleton used by Empty[W]String[16] to be a unique type. This | 32 // Force the singleton used by Empty[W]String[16] to be a unique type. This |
33 // prevents other code that might accidentally use Singleton<string> from | 33 // prevents other code that might accidentally use Singleton<string> from |
34 // getting our internal one. | 34 // getting our internal one. |
35 struct EmptyStrings { | 35 struct EmptyStrings { |
36 EmptyStrings() {} | 36 EmptyStrings() {} |
37 const std::string s; | 37 const std::string s; |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 } | 1003 } |
1004 | 1004 |
1005 } // namespace | 1005 } // namespace |
1006 | 1006 |
1007 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) { | 1007 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) { |
1008 return lcpyT<char>(dst, src, dst_size); | 1008 return lcpyT<char>(dst, src, dst_size); |
1009 } | 1009 } |
1010 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) { | 1010 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) { |
1011 return lcpyT<wchar_t>(dst, src, dst_size); | 1011 return lcpyT<wchar_t>(dst, src, dst_size); |
1012 } | 1012 } |
OLD | NEW |