OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_split.h" | 5 #include "base/string_split.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/third_party/icu/icu_utf.h" | 9 #include "base/third_party/icu/icu_utf.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 } | 193 } |
194 break; | 194 break; |
195 } | 195 } |
196 } | 196 } |
197 if (!last_was_ws) { | 197 if (!last_was_ws) { |
198 result->push_back( | 198 result->push_back( |
199 str.substr(last_non_ws_start, length - last_non_ws_start)); | 199 str.substr(last_non_ws_start, length - last_non_ws_start)); |
200 } | 200 } |
201 } | 201 } |
202 | 202 |
203 void SplitStringAlongWhitespace(const std::wstring& str, | |
204 std::vector<std::wstring>* result) { | |
205 SplitStringAlongWhitespaceT(str, result); | |
206 } | |
207 | |
208 #if !defined(WCHAR_T_IS_UTF16) | |
209 void SplitStringAlongWhitespace(const string16& str, | 203 void SplitStringAlongWhitespace(const string16& str, |
210 std::vector<string16>* result) { | 204 std::vector<string16>* result) { |
211 SplitStringAlongWhitespaceT(str, result); | 205 SplitStringAlongWhitespaceT(str, result); |
212 } | 206 } |
213 #endif | |
214 | 207 |
215 void SplitStringAlongWhitespace(const std::string& str, | 208 void SplitStringAlongWhitespace(const std::string& str, |
216 std::vector<std::string>* result) { | 209 std::vector<std::string>* result) { |
217 SplitStringAlongWhitespaceT(str, result); | 210 SplitStringAlongWhitespaceT(str, result); |
218 } | 211 } |
219 | 212 |
220 } // namespace base | 213 } // namespace base |
OLD | NEW |