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

Side by Side Diff: base/string_split.h

Issue 3366011: base: Move SplitStringDontTrim functions from string_util.h to string_split.h (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: remove dchecks Created 10 years, 3 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/mime_util_xdg.cc ('k') | base/string_split.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef BASE_STRING_SPLIT_H_ 5 #ifndef BASE_STRING_SPLIT_H_
6 #define BASE_STRING_SPLIT_H_ 6 #define BASE_STRING_SPLIT_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 15 matching lines...) Expand all
26 std::vector<std::pair<std::string, std::string> >* kv_pairs); 26 std::vector<std::pair<std::string, std::string> >* kv_pairs);
27 27
28 // The same as SplitString, but use a substring delimiter instead of a char. 28 // The same as SplitString, but use a substring delimiter instead of a char.
29 void SplitStringUsingSubstr(const string16& str, 29 void SplitStringUsingSubstr(const string16& str,
30 const string16& s, 30 const string16& s,
31 std::vector<string16>* r); 31 std::vector<string16>* r);
32 void SplitStringUsingSubstr(const std::string& str, 32 void SplitStringUsingSubstr(const std::string& str,
33 const std::string& s, 33 const std::string& s,
34 std::vector<std::string>* r); 34 std::vector<std::string>* r);
35 35
36 // The same as SplitString, but don't trim white space.
37 // Where wchar_t is char16 (i.e. Windows), |c| must be in BMP
38 // (Basic Multilingual Plane). Elsewhere (Linux/Mac), wchar_t
39 // should be a valid Unicode code point (32-bit).
40 void SplitStringDontTrim(const std::wstring& str,
41 wchar_t c,
42 std::vector<std::wstring>* r);
43 // NOTE: |c| must be in BMP (Basic Multilingual Plane)
44 void SplitStringDontTrim(const string16& str,
45 char16 c,
46 std::vector<string16>* r);
47 // |str| should not be in a multi-byte encoding like Shift-JIS or GBK in which
48 // the trailing byte of a multi-byte character can be in the ASCII range.
49 // UTF-8, and other single/multi-byte ASCII-compatible encodings are OK.
50 // Note: |c| must be in the ASCII range.
51 void SplitStringDontTrim(const std::string& str,
52 char c,
53 std::vector<std::string>* r);
54
36 } // namespace base 55 } // namespace base
37 56
38 #endif // BASE_STRING_SPLIT_H 57 #endif // BASE_STRING_SPLIT_H
OLDNEW
« no previous file with comments | « base/mime_util_xdg.cc ('k') | base/string_split.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698