chromium/third_party/blink/renderer/platform/wtf/text/string_view.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/platform/wtf/text/string_view.h"

#include <unicode/utf16.h>

#include "base/check.h"
#include "third_party/blink/renderer/platform/wtf/text/ascii_fast_path.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"
#include "third_party/blink/renderer/platform/wtf/text/code_point_iterator.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/text/string_impl.h"
#include "third_party/blink/renderer/platform/wtf/text/utf8.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"

namespace WTF {
namespace {
class StackStringViewAllocator {};
}  // namespace

StringView::StringView(const UChar* chars)
    :{}

#if DCHECK_IS_ON()
StringView::~StringView() {}
#endif

// Helper to write a three-byte UTF-8 code point to the buffer, caller must
// check room is available.
static inline void PutUTF8Triple(char*& buffer, UChar ch) {}

std::string StringView::Utf8(UTF8ConversionMode mode) const {}

bool StringView::ContainsOnlyASCIIOrEmpty() const {}

bool StringView::SubstringContainsOnlyWhitespaceOrEmpty(unsigned from,
                                                        unsigned to) const {}

String StringView::ToString() const {}

AtomicString StringView::ToAtomicString() const {}

String StringView::EncodeForDebugging() const {}

bool EqualStringView(const StringView& a, const StringView& b) {}

bool DeprecatedEqualIgnoringCaseAndNullity(const StringView& a,
                                           const StringView& b) {}

bool DeprecatedEqualIgnoringCase(const StringView& a, const StringView& b) {}

bool EqualIgnoringASCIICase(const StringView& a, const StringView& b) {}

StringView StringView::LowerASCIIMaybeUsingBuffer(
    StackBackingStore& buffer) const {}

UChar32 StringView::CodepointAt(unsigned i) const {}

unsigned StringView::NextCodePointOffset(unsigned i) const {}

CodePointIterator StringView::begin() const {}

CodePointIterator StringView::end() const {}

std::ostream& operator<<(std::ostream& out, const StringView& string) {}

}  // namespace WTF