1 // Copyright 2020 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_STRINGS_STRING_SPLIT_WIN_H_ 6 #define BASE_STRINGS_STRING_SPLIT_WIN_H_ 7 8 #include <string> 9 #include <string_view> 10 #include <vector> 11 12 #include "base/base_export.h" 13 #include "base/strings/string_piece.h" 14 #include "base/strings/string_split.h" 15 16 namespace base { 17 18 // The following section contains overloads of the cross-platform APIs for 19 // std::wstring and std::wstring_view. 20 [[nodiscard]] BASE_EXPORT std::vector<std::wstring> SplitString( 21 std::wstring_view input, 22 std::wstring_view separators, 23 WhitespaceHandling whitespace, 24 SplitResult result_type); 25 26 [[nodiscard]] BASE_EXPORT std::vector<std::wstring_view> SplitStringPiece( 27 std::wstring_view input, 28 std::wstring_view separators, 29 WhitespaceHandling whitespace, 30 SplitResult result_type); 31 32 [[nodiscard]] BASE_EXPORT std::vector<std::wstring> SplitStringUsingSubstr( 33 std::wstring_view input, 34 std::wstring_view delimiter, 35 WhitespaceHandling whitespace, 36 SplitResult result_type); 37 38 [[nodiscard]] BASE_EXPORT std::vector<std::wstring_view> 39 SplitStringPieceUsingSubstr(std::wstring_view input, 40 std::wstring_view delimiter, 41 WhitespaceHandling whitespace, 42 SplitResult result_type); 43 44 } // namespace base 45 46 #endif // BASE_STRINGS_STRING_SPLIT_WIN_H_ 47