chromium/components/shared_highlighting/core/common/text_fragment.cc

// 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.

#include "components/shared_highlighting/core/common/text_fragment.h"

#include <sstream>

#include "base/strings/escape.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "components/shared_highlighting/core/common/fragment_directives_constants.h"

namespace {

// Escapes any special character such that the fragment can be added to a URL.
std::string Escape(const std::string& str) {}

// Unescapes any special character from a fragment which may be coming from a
// URL. Returns nullopt if the fragment can't be safely escaped (e.g., contains
// non-UTF8 characters).
std::optional<std::string> Unescape(const std::string& str) {}

bool HasValue(const std::string* str) {}

const std::string ValueOrDefault(const std::string* str) {}

}  // namespace

namespace shared_highlighting {

TextFragment::TextFragment(const std::string& text_start)
    :{}

TextFragment::TextFragment(const std::string& text_start,
                           const std::string& text_end,
                           const std::string& prefix,
                           const std::string& suffix)
    :{}

TextFragment::TextFragment(const TextFragment& other)
    :{}

TextFragment::~TextFragment() = default;

// static
std::optional<TextFragment> TextFragment::FromEscapedString(
    std::string escaped_string) {}

// static
std::optional<TextFragment> TextFragment::FromValue(const base::Value* value) {}

std::string TextFragment::ToEscapedString() const {}

base::Value TextFragment::ToValue() const {}

}  // namespace shared_highlighting