chromium/media/formats/hls/source_string.h

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

#ifndef MEDIA_FORMATS_HLS_SOURCE_STRING_H_
#define MEDIA_FORMATS_HLS_SOURCE_STRING_H_

#include <cstdint>
#include <string_view>

#include "base/types/pass_key.h"
#include "media/base/media_export.h"
#include "media/formats/hls/parse_status.h"

namespace media::hls {

struct SourceLineIterator;
class VariableDictionary;
class ResolvedSourceString;

namespace subtle {

// This structure represents contents of a single line in an HLS manifest, not
// including the line ending. This may be the entire line, or a substring of the
// line (clipped at either/both ends).
template <typename Self>
class MEDIA_EXPORT SourceStringBase {};

}  // namespace subtle

// A `SourceString` is a slice of the original manifest string that may contain
// unresolved variable references.
class MEDIA_EXPORT SourceString final
    : public subtle::SourceStringBase<SourceString> {};

// A `ResolvedSourceString` is a string slice that has either undergone or
// skipped variable substitution, and may differ from the original source.
class MEDIA_EXPORT ResolvedSourceString final
    : public subtle::SourceStringBase<ResolvedSourceString> {};

// Exposes a line-based iteration API over the source text of an HLS manifest.
struct MEDIA_EXPORT SourceLineIterator {};

}  // namespace media::hls

#endif  // MEDIA_FORMATS_HLS_SOURCE_STRING_H_