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

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

Issue 1124763003: Update from https://crrev.com/327068 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: update nacl, buildtools, fix display_change_notifier_unittest Created 5 years, 7 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
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/strings/utf_string_conversions.h"
10 #include "base/third_party/icu/icu_utf.h" 9 #include "base/third_party/icu/icu_utf.h"
11 10
12 namespace base { 11 namespace base {
13 12
14 namespace { 13 namespace {
15 14
16 template <typename STR> 15 template <typename STR>
17 void SplitStringT(const STR& str, 16 void SplitStringT(const STR& str,
18 const typename STR::value_type s, 17 const typename STR::value_type s,
19 bool trim_whitespace, 18 bool trim_whitespace,
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 void SplitStringDontTrim(const string16& str, 185 void SplitStringDontTrim(const string16& str,
187 char16 c, 186 char16 c,
188 std::vector<string16>* r) { 187 std::vector<string16>* r) {
189 DCHECK(CBU16_IS_SINGLE(c)); 188 DCHECK(CBU16_IS_SINGLE(c));
190 SplitStringT(str, c, false, r); 189 SplitStringT(str, c, false, r);
191 } 190 }
192 191
193 void SplitStringDontTrim(const std::string& str, 192 void SplitStringDontTrim(const std::string& str,
194 char c, 193 char c,
195 std::vector<std::string>* r) { 194 std::vector<std::string>* r) {
196 DCHECK(IsStringUTF8(str));
197 #if CHAR_MIN < 0 195 #if CHAR_MIN < 0
198 DCHECK_GE(c, 0); 196 DCHECK_GE(c, 0);
199 #endif 197 #endif
200 DCHECK_LT(c, 0x7F); 198 DCHECK_LT(c, 0x7F);
201 SplitStringT(str, c, false, r); 199 SplitStringT(str, c, false, r);
202 } 200 }
203 201
204 void SplitStringAlongWhitespace(const string16& str, 202 void SplitStringAlongWhitespace(const string16& str,
205 std::vector<string16>* result) { 203 std::vector<string16>* result) {
206 SplitStringAlongWhitespaceT(str, result); 204 SplitStringAlongWhitespaceT(str, result);
207 } 205 }
208 206
209 void SplitStringAlongWhitespace(const std::string& str, 207 void SplitStringAlongWhitespace(const std::string& str,
210 std::vector<std::string>* result) { 208 std::vector<std::string>* result) {
211 SplitStringAlongWhitespaceT(str, result); 209 SplitStringAlongWhitespaceT(str, result);
212 } 210 }
213 211
214 } // namespace base 212 } // namespace base
OLDNEW
« no previous file with comments | « base/stl_util.h ('k') | base/sync_socket.h » ('j') | mojo/public/tools/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698