#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 {
std::string Escape(const std::string& str) { … }
std::optional<std::string> Unescape(const std::string& str) { … }
bool HasValue(const std::string* str) { … }
const std::string ValueOrDefault(const std::string* str) { … }
}
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;
std::optional<TextFragment> TextFragment::FromEscapedString(
std::string escaped_string) { … }
std::optional<TextFragment> TextFragment::FromValue(const base::Value* value) { … }
std::string TextFragment::ToEscapedString() const { … }
base::Value TextFragment::ToValue() const { … }
}