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 #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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 std::vector<std::string>* r); | 65 std::vector<std::string>* r); |
66 | 66 |
67 // WARNING: this uses whitespace as defined by the HTML5 spec. If you need | 67 // WARNING: this uses whitespace as defined by the HTML5 spec. If you need |
68 // a function similar to this but want to trim all types of whitespace, then | 68 // a function similar to this but want to trim all types of whitespace, then |
69 // factor this out into a function that takes a string containing the characters | 69 // factor this out into a function that takes a string containing the characters |
70 // that are treated as whitespace. | 70 // that are treated as whitespace. |
71 // | 71 // |
72 // Splits the string along whitespace (where whitespace is the five space | 72 // Splits the string along whitespace (where whitespace is the five space |
73 // characters defined by HTML 5). Each contiguous block of non-whitespace | 73 // characters defined by HTML 5). Each contiguous block of non-whitespace |
74 // characters is added to result. | 74 // characters is added to result. |
75 BASE_EXPORT void SplitStringAlongWhitespace(const std::wstring& str, | |
76 std::vector<std::wstring>* result); | |
77 BASE_EXPORT void SplitStringAlongWhitespace(const string16& str, | 75 BASE_EXPORT void SplitStringAlongWhitespace(const string16& str, |
78 std::vector<string16>* result); | 76 std::vector<string16>* result); |
79 BASE_EXPORT void SplitStringAlongWhitespace(const std::string& str, | 77 BASE_EXPORT void SplitStringAlongWhitespace(const std::string& str, |
80 std::vector<std::string>* result); | 78 std::vector<std::string>* result); |
81 | 79 |
82 } // namespace base | 80 } // namespace base |
83 | 81 |
84 #endif // BASE_STRING_SPLIT_H | 82 #endif // BASE_STRING_SPLIT_H |
OLD | NEW |