OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_util.h" | 5 #include "base/strings/string_util.h" |
6 | 6 |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <math.h> | 9 #include <math.h> |
10 #include <stdarg.h> | 10 #include <stdarg.h> |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 else | 300 else |
301 output->clear(); | 301 output->clear(); |
302 } | 302 } |
303 | 303 |
304 TrimPositions TrimWhitespace(const string16& input, | 304 TrimPositions TrimWhitespace(const string16& input, |
305 TrimPositions positions, | 305 TrimPositions positions, |
306 string16* output) { | 306 string16* output) { |
307 return TrimStringT(input, StringPiece16(kWhitespaceUTF16), positions, output); | 307 return TrimStringT(input, StringPiece16(kWhitespaceUTF16), positions, output); |
308 } | 308 } |
309 | 309 |
| 310 StringPiece16 TrimWhitespaceASCII(StringPiece16 input, |
| 311 TrimPositions positions) { |
| 312 return TrimStringPieceT(input, StringPiece16(kWhitespaceUTF16), positions); |
| 313 } |
| 314 |
310 TrimPositions TrimWhitespaceASCII(const std::string& input, | 315 TrimPositions TrimWhitespaceASCII(const std::string& input, |
311 TrimPositions positions, | 316 TrimPositions positions, |
312 std::string* output) { | 317 std::string* output) { |
313 return TrimStringT(input, StringPiece(kWhitespaceASCII), positions, output); | 318 return TrimStringT(input, StringPiece(kWhitespaceASCII), positions, output); |
314 } | 319 } |
315 | 320 |
| 321 StringPiece TrimWhitespaceASCII(StringPiece input, TrimPositions positions) { |
| 322 return TrimStringPieceT(input, StringPiece(kWhitespaceASCII), positions); |
| 323 } |
| 324 |
316 // This function is only for backward-compatibility. | 325 // This function is only for backward-compatibility. |
317 // To be removed when all callers are updated. | 326 // To be removed when all callers are updated. |
318 TrimPositions TrimWhitespace(const std::string& input, | 327 TrimPositions TrimWhitespace(const std::string& input, |
319 TrimPositions positions, | 328 TrimPositions positions, |
320 std::string* output) { | 329 std::string* output) { |
321 return TrimWhitespaceASCII(input, positions, output); | 330 return TrimWhitespaceASCII(input, positions, output); |
322 } | 331 } |
323 | 332 |
324 template<typename STR> | 333 template<typename STR> |
325 STR CollapseWhitespaceT(const STR& text, | 334 STR CollapseWhitespaceT(const STR& text, |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 } | 1135 } |
1127 | 1136 |
1128 } // namespace | 1137 } // namespace |
1129 | 1138 |
1130 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) { | 1139 size_t base::strlcpy(char* dst, const char* src, size_t dst_size) { |
1131 return lcpyT<char>(dst, src, dst_size); | 1140 return lcpyT<char>(dst, src, dst_size); |
1132 } | 1141 } |
1133 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) { | 1142 size_t base::wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size) { |
1134 return lcpyT<wchar_t>(dst, src, dst_size); | 1143 return lcpyT<wchar_t>(dst, src, dst_size); |
1135 } | 1144 } |
OLD | NEW |