chromium/media/formats/hls/types.cc

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

#include "media/formats/hls/types.h"

#include <cmath>
#include <functional>
#include <limits>

#include "base/containers/contains.h"
#include "base/no_destructor.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "media/formats/hls/parse_status.h"
#include "media/formats/hls/source_string.h"
#include "third_party/re2/src/re2/re2.h"

namespace media::hls::types {

namespace parsing {

// static
ParseStatus::Or<base::TimeDelta> TimeDelta::Parse(ResolvedSourceString str) {}

// static
ParseStatus::Or<ByteRangeExpression> ByteRangeExpression::Parse(
    ResolvedSourceString source_str) {}

// static
ParseStatus::Or<ResolvedSourceString> RawStr::Parse(ResolvedSourceString str) {}

// static
ParseStatus::Or<bool> YesOrNo::Parse(ResolvedSourceString str) {}

}  // namespace parsing

namespace {
bool IsOneOf(char c, std::string_view set) {}

// Returns the substring matching a valid AttributeName, advancing `source_str`
// to the following character. If no such substring exists, returns
// `std::nullopt` and leaves `source_str` untouched. This is like matching the
// regex `^[A-Z0-9-]+`.
std::optional<SourceString> ExtractAttributeName(SourceString* source_str) {}

// Returns the substring matching a valid AttributeValue, advancing `source_str`
// to the following character. If no such substring exists, returns
// `std::nullopt` and leaves `source_str` untouched.
// Attribute values may either be quoted or unquoted.
// Quoted attribute values begin and end with a double-quote ("), and may
// contain internal whitespace and commas. Unquoted attribute values must not
// begin with a double-quote, but may contain any character excluding whitespace
// and commas.
std::optional<SourceString> ExtractAttributeValue(SourceString* source_str) {}

}  // namespace

ParseStatus::Or<DecimalInteger> ParseDecimalInteger(
    ResolvedSourceString source_str) {}

ParseStatus::Or<DecimalFloatingPoint> ParseDecimalFloatingPoint(
    ResolvedSourceString source_str) {}

ParseStatus::Or<SignedDecimalFloatingPoint> ParseSignedDecimalFloatingPoint(
    ResolvedSourceString source_str) {}

// static
ParseStatus::Or<DecimalResolution> DecimalResolution::Parse(
    ResolvedSourceString source_str) {}


// static
std::optional<ByteRange> ByteRange::Validate(DecimalInteger length,
                                             DecimalInteger offset) {}

ParseStatus::Or<ResolvedSourceString> ParseQuotedString(
    SourceString source_str,
    const VariableDictionary& variable_dict,
    VariableDictionary::SubstitutionBuffer& sub_buffer,
    bool allow_empty) {}

ParseStatus::Or<SourceString> ParseQuotedStringWithoutSubstitution(
    SourceString source_str,
    bool allow_empty) {}

AttributeListIterator::AttributeListIterator(SourceString content)
    :{}

ParseStatus::Or<AttributeListIterator::Item> AttributeListIterator::Next() {}

AttributeMap::AttributeMap(base::span<Item> sorted_items)
    :{}

ParseStatus::Or<AttributeListIterator::Item> AttributeMap::Fill(
    AttributeListIterator* iter) {}

ParseStatus AttributeMap::FillUntilError(AttributeListIterator* iter) {}

AttributeMap::~AttributeMap() = default;

// static
ParseStatus::Or<VariableName> VariableName::Parse(SourceString source_str) {}

// static
ParseStatus::Or<StableId> StableId::Parse(ResolvedSourceString str) {}

// static
ParseStatus::Or<InstreamId> InstreamId::Parse(ResolvedSourceString str) {}

AudioChannels::AudioChannels(DecimalInteger max_channels,
                             std::vector<std::string> audio_coding_identifiers)
    :{}

AudioChannels::AudioChannels(const AudioChannels&) = default;

AudioChannels::AudioChannels(AudioChannels&&) = default;

AudioChannels& AudioChannels::operator=(const AudioChannels&) = default;

AudioChannels& AudioChannels::operator=(AudioChannels&&) = default;

AudioChannels::~AudioChannels() = default;

// static
ParseStatus::Or<AudioChannels> AudioChannels::Parse(ResolvedSourceString str) {}

}  // namespace media::hls::types