chromium/base/strings/string_split_internal.h

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_STRINGS_STRING_SPLIT_INTERNAL_H_
#define BASE_STRINGS_STRING_SPLIT_INTERNAL_H_

#include <string_view>
#include <vector>

#include "base/strings/string_util.h"

namespace base {

namespace internal {

// Returns either the ASCII or UTF-16 whitespace.
template <typename CharT>
std::basic_string_view<CharT> WhitespaceForType();

template <>
inline std::u16string_view WhitespaceForType<char16_t>() {}
template <>
inline std::string_view WhitespaceForType<char>() {}

// General string splitter template. Can take 8- or 16-bit input, can produce
// the corresponding string or std::string_view output.
template <typename OutputStringType,
          typename T,
          typename CharT = typename T::value_type>
static std::vector<OutputStringType> SplitStringT(T str,
                                                  T delimiter,
                                                  WhitespaceHandling whitespace,
                                                  SplitResult result_type) {}

template <typename OutputStringType,
          typename T,
          typename CharT = typename T::value_type>
std::vector<OutputStringType> SplitStringUsingSubstrT(
    T input,
    T delimiter,
    WhitespaceHandling whitespace,
    SplitResult result_type) {}

}  // namespace internal

}  // namespace base

#endif  // BASE_STRINGS_STRING_SPLIT_INTERNAL_H_