libmpd++
DASH MPD parsing and manipulation library
 
Loading...
Searching...
No Matches
com::bbc::libmpdpp::Codecs Class Reference

#include <libmpd++/Codecs.hh>

Classes

class  Encoding
 

Public Member Functions

 Codecs ()
 
 Codecs (const std::string &attr_value)
 
 Codecs (const Codecs &to_copy)
 
 Codecs (Codecs &&to_move)
 
virtual ~Codecs ()
 
Codecsoperator= (const Codecs &to_copy)
 
Codecsoperator= (Codecs &&to_move)
 
bool operator== (const Codecs &to_compare) const
 
 operator std::string () const
 String cast operator.
 
bool hasEncoding () const
 
const std::optional< Encoding > & encoding () const
 
Codecsencoding (const std::nullopt_t &)
 
const std::list< std::string > & codecs () const
 
const std::string & codec (std::list< std::string >::size_type idx) const
 
CodecscodecsRemove (const std::string &codec)
 
Codecsencoding (const Encoding &enc)
 
Codecsencoding (Encoding &&enc)
 
Codecsencoding (const std::optional< Encoding > &enc)
 
Codecsencoding (std::optional< Encoding > &&enc)
 
std::list< std::string >::const_iterator cbegin () const
 
std::list< std::string >::const_iterator begin () const
 
std::list< std::string >::iterator begin ()
 
std::list< std::string >::const_iterator codecsBegin () const
 
std::list< std::string >::iterator codecsBegin ()
 
std::list< std::string >::const_iterator cend () const
 
std::list< std::string >::const_iterator end () const
 
std::list< std::string >::iterator end ()
 
std::list< std::string >::const_iterator codecsEnd () const
 
std::list< std::string >::iterator codecsEnd ()
 
CodecscodecsAdd (const std::string &codec)
 
CodecscodecsAdd (std::string &&codec)
 
CodecscodecsRemove (const std::list< std::string >::const_iterator &it)
 
CodecscodecsRemove (const std::list< std::string >::iterator &it)
 

Detailed Description

Codecs class

This class models the codecs listed in an @codecs attribute in a DASH MPD.

This is a container for the CodecsType from the DASH MPD XML schema from ISO 23009-1:2022 Clause 5.3.7.3.

Constructor & Destructor Documentation

◆ Codecs() [1/4]

com::bbc::libmpdpp::Codecs::Codecs ( )

Default constructor

Creates an empty Codecs.

◆ Codecs() [2/4]

com::bbc::libmpdpp::Codecs::Codecs ( const std::string & attr_value)

Construct from an attribute value string

Parameters
attr_valueThe attribute value string to split into a Codecs list.

◆ Codecs() [3/4]

com::bbc::libmpdpp::Codecs::Codecs ( const Codecs & to_copy)

Copy constructor

Creates a new Codecs object which is a copy of to_copy.

Parameters
to_copyThe Codecs object to copy.

◆ Codecs() [4/4]

com::bbc::libmpdpp::Codecs::Codecs ( Codecs && to_move)

Move constructor

Creates a new Codecs object which transfers the resources from to_move.

Parameters
to_moveThe Codecs object to move.

◆ ~Codecs()

virtual com::bbc::libmpdpp::Codecs::~Codecs ( )
inlinevirtual

Destructor

Member Function Documentation

◆ begin() [1/2]

std::list< std::string >::iterator com::bbc::libmpdpp::Codecs::begin ( )
inline

Get an iterator for the start of the Codecs list

Returns
An iterator pointing to the start of the Codecs list.

◆ begin() [2/2]

std::list< std::string >::const_iterator com::bbc::libmpdpp::Codecs::begin ( ) const
inline

Get an iterator for the start of the Codecs list

Returns
An iterator pointing to the start of the Codecs list.

◆ cbegin()

std::list< std::string >::const_iterator com::bbc::libmpdpp::Codecs::cbegin ( ) const
inline

Get an iterator for the start of the Codecs list

Returns
An iterator pointing to the start of the Codecs list.

◆ cend()

std::list< std::string >::const_iterator com::bbc::libmpdpp::Codecs::cend ( ) const
inline

Get an iterator for the end of the Codecs list

Returns
An iterator pointing to the end of the Codecs list.

◆ codec()

const std::string & com::bbc::libmpdpp::Codecs::codec ( std::list< std::string >::size_type idx) const

Get a codec from the list

Parameters
idxThe index of the codec to get, starting at 0 for the first codec.
Returns
The codec value at index idx.
Exceptions
std::out_of_rangeIf idx is greater than or equal to the number of codecs in the list.

◆ codecs()

const std::list< std::string > & com::bbc::libmpdpp::Codecs::codecs ( ) const
inline

Get the codecs list

Returns
ths codecs list for this Codecs list object.

◆ codecsAdd() [1/2]

Codecs & com::bbc::libmpdpp::Codecs::codecsAdd ( const std::string & codec)
inline

Add a codec to the list

Parameters
codecThe codec to add to the codecs list.
Returns
This Codecs list object.

◆ codecsAdd() [2/2]

Codecs & com::bbc::libmpdpp::Codecs::codecsAdd ( std::string && codec)
inline

Add a codec to the list

Parameters
codecThe codec to add to the codecs list.
Returns
This Codecs list object.

◆ codecsBegin() [1/2]

std::list< std::string >::iterator com::bbc::libmpdpp::Codecs::codecsBegin ( )
inline

Get an iterator for the start of the Codecs list

Returns
An iterator pointing to the start of the Codecs list.

◆ codecsBegin() [2/2]

std::list< std::string >::const_iterator com::bbc::libmpdpp::Codecs::codecsBegin ( ) const
inline

Get an iterator for the start of the Codecs list

Returns
An iterator pointing to the start of the Codecs list.

◆ codecsEnd() [1/2]

std::list< std::string >::iterator com::bbc::libmpdpp::Codecs::codecsEnd ( )
inline

Get an iterator for the end of the Codecs list

Returns
An iterator pointing to the end of the Codecs list.

◆ codecsEnd() [2/2]

std::list< std::string >::const_iterator com::bbc::libmpdpp::Codecs::codecsEnd ( ) const
inline

Get an iterator for the end of the Codecs list

Returns
An iterator pointing to the end of the Codecs list.

◆ codecsRemove() [1/3]

Codecs & com::bbc::libmpdpp::Codecs::codecsRemove ( const std::list< std::string >::const_iterator & it)

Remove a codec by iterator

Parameters
itIterator referencing the codec to remove from the list.
Returns
This Codecs list object.

◆ codecsRemove() [2/3]

Codecs & com::bbc::libmpdpp::Codecs::codecsRemove ( const std::list< std::string >::iterator & it)

Remove a codec by iterator

Parameters
itIterator referencing the codec to remove from the list.
Returns
This Codecs list object.

◆ codecsRemove() [3/3]

Codecs & com::bbc::libmpdpp::Codecs::codecsRemove ( const std::string & codec)

Remove a codec by value

Remove a codec from the list which has the same value as codec.

Parameters
codecThe value to remove from the list.
Returns
This Codecs list object.

◆ encoding() [1/6]

const std::optional< Encoding > & com::bbc::libmpdpp::Codecs::encoding ( ) const
inline

Get the codecs encoding

Returns
The optional codecs encoding.

◆ encoding() [2/6]

Codecs & com::bbc::libmpdpp::Codecs::encoding ( const Encoding & enc)
inline

Set the codec encoding

Parameters
encThe encoding to set for this Codecs object.
Returns
This Codecs object.

◆ encoding() [3/6]

Codecs & com::bbc::libmpdpp::Codecs::encoding ( const std::nullopt_t & )
inline

Unset the codec encoding

Remove any encoding set on this Codecs object.

Returns
This Codecs object.

◆ encoding() [4/6]

Codecs & com::bbc::libmpdpp::Codecs::encoding ( const std::optional< Encoding > & enc)
inline

Set the codec encoding

Parameters
encThe encoding to set for this Codecs object.
Returns
This Codecs object.

◆ encoding() [5/6]

Codecs & com::bbc::libmpdpp::Codecs::encoding ( Encoding && enc)
inline

Set the codec encoding

Parameters
encThe encoding to set for this Codecs object.
Returns
This Codecs object.

◆ encoding() [6/6]

Codecs & com::bbc::libmpdpp::Codecs::encoding ( std::optional< Encoding > && enc)
inline

Set the codec encoding

Parameters
encThe encoding to set for this Codecs object.
Returns
This Codecs object.

◆ end() [1/2]

std::list< std::string >::iterator com::bbc::libmpdpp::Codecs::end ( )
inline

Get an iterator for the end of the Codecs list

Returns
An iterator pointing to the end of the Codecs list.

◆ end() [2/2]

std::list< std::string >::const_iterator com::bbc::libmpdpp::Codecs::end ( ) const
inline

Get an iterator for the end of the Codecs list

Returns
An iterator pointing to the end of the Codecs list.

◆ hasEncoding()

bool com::bbc::libmpdpp::Codecs::hasEncoding ( ) const
inline

Check if this Codecs list has an encoding set

Returns
true if an Encoding object is set on this Codecs list object.

◆ operator std::string()

com::bbc::libmpdpp::Codecs::operator std::string ( ) const

String cast operator.

@pnchor Codecs_operator_std_string

This converts the Codecs list into a string suitable for use in a @codecs attribute in an MPD.

Returns
The attribute string value for the Codecs list.

◆ operator=() [1/2]

Codecs & com::bbc::libmpdpp::Codecs::operator= ( Codecs && to_move)

Move operator

Transfers the resources from to_move into this Codecs object.

Parameters
to_moveThe Codecs object to move.
Returns
This Codes object.

◆ operator=() [2/2]

Codecs & com::bbc::libmpdpp::Codecs::operator= ( const Codecs & to_copy)

Copy operator

Copies the values from to_copy into this Codecs object.

Parameters
to_copyThe Codecs object to copy.
Returns
This Codecs object.

◆ operator==()

bool com::bbc::libmpdpp::Codecs::operator== ( const Codecs & to_compare) const

Equality operator

Compares this Codecs with another for equality.

Parameters
to_compareA constant reference to the Codecs instance to compare against.
Returns
true if the Codecs are considered equal, false otherwise..

The documentation for this class was generated from the following file: