Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: base/strings/string_split.cc

Issue 1284833004: Remove remaining legacy SplitString calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/strings/string_split.h ('k') | base/strings/string_split_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/strings/string_split.h" 5 #include "base/strings/string_split.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/third_party/icu/icu_utf.h" 9 #include "base/third_party/icu/icu_utf.h"
10 10
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 std::vector<string16>* r) { 264 std::vector<string16>* r) {
265 SplitStringUsingSubstrT(str, s, r); 265 SplitStringUsingSubstrT(str, s, r);
266 } 266 }
267 267
268 void SplitStringUsingSubstr(const std::string& str, 268 void SplitStringUsingSubstr(const std::string& str,
269 const std::string& s, 269 const std::string& s,
270 std::vector<std::string>* r) { 270 std::vector<std::string>* r) {
271 SplitStringUsingSubstrT(str, s, r); 271 SplitStringUsingSubstrT(str, s, r);
272 } 272 }
273 273
274 void SplitStringDontTrim(StringPiece16 str,
275 char16 c,
276 std::vector<string16>* result) {
277 DCHECK(CBU16_IS_SINGLE(c));
278 *result = SplitStringT<string16, string16, char16>(
279 str, c, KEEP_WHITESPACE, SPLIT_WANT_ALL);
280 }
281
282 void SplitStringDontTrim(StringPiece str,
283 char c,
284 std::vector<std::string>* result) {
285 #if CHAR_MIN < 0
286 DCHECK_GE(c, 0);
287 #endif
288 DCHECK_LT(c, 0x7F);
289 *result = SplitStringT<std::string, std::string, char>(
290 str, c, KEEP_WHITESPACE, SPLIT_WANT_ALL);
291 }
292
293 void SplitStringAlongWhitespace(const string16& str,
294 std::vector<string16>* result) {
295 *result = SplitStringT<string16, string16, StringPiece16>(
296 str, StringPiece16(kWhitespaceASCIIAs16),
297 TRIM_WHITESPACE, SPLIT_WANT_NONEMPTY);
298 }
299
300 void SplitStringAlongWhitespace(const std::string& str,
301 std::vector<std::string>* result) {
302 *result = SplitStringT<std::string, std::string, StringPiece>(
303 str, StringPiece(kWhitespaceASCII),
304 TRIM_WHITESPACE, SPLIT_WANT_NONEMPTY);
305 }
306
307 } // namespace base 274 } // namespace base
OLDNEW
« no previous file with comments | « base/strings/string_split.h ('k') | base/strings/string_split_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698