TSDuck v3.46-4930
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::hls::TagAttributes Class Reference

#include <tshlsTagAttributes.h>

Public Member Functions

 TagAttributes (const UString &params=UString())
void clear ()
template<typename INT>
requires std::integral<INT>
void getIntValue (INT &val, const UString &name, INT def_value=static_cast< INT >(0)) const
template<typename INT>
requires std::integral<INT>
void getMilliValue (INT &val, const UString &name, INT def_value=static_cast< INT >(0)) const
template<class NUMBER>
requires std::derived_from<NUMBER, AbstractNumber>
void getValue (NUMBER &val, const UString &name, const NUMBER &def_value=NUMBER()) const
bool present (const UString &name) const
void reload (const UString &params=UString())
UString value (const UString &name, const UString &def_value=UString()) const

Static Public Member Functions

template<class Rep, class Period>
static bool ToMilliValue (cn::duration< Rep, Period > &value, const UString &str)
template<typename INT>
requires std::integral<INT>
static bool ToMilliValue (INT &value, const UString &str)

Detailed Description

Attributes of a tag in an HLS playlist.

Constructor & Destructor Documentation

◆ TagAttributes()

ts::hls::TagAttributes::TagAttributes ( const UString & params = UString())

Constructor.

Parameters
[in]paramsString parameter of the tag in the playlist line.

Member Function Documentation

◆ reload()

void ts::hls::TagAttributes::reload ( const UString & params = UString())

Reload the contents of the attributes.

Parameters
[in]paramsString parameter of the tag in the playlist line.

◆ clear()

void ts::hls::TagAttributes::clear ( )
inline

Clear the content of the attributes.

◆ present()

bool ts::hls::TagAttributes::present ( const UString & name) const

Check if an attribute is present.

Parameters
[in]nameAttribute name.
Returns
True if the attribute is present.

◆ value()

UString ts::hls::TagAttributes::value ( const UString & name,
const UString & def_value = UString() ) const

Get the value of a string attribute.

Parameters
[in]nameAttribute name.
[in]def_valueDefault value if not present.
Returns
Attribute value.

◆ getIntValue()

template<typename INT>
requires std::integral<INT>
void ts::hls::TagAttributes::getIntValue ( INT & val,
const UString & name,
INT def_value = static_cast<INT>(0) ) const
inline

Get the value of an integer attribute.

Template Parameters
INTAn integer type.
Parameters
[out]valDecoded value.
[in]nameAttribute name.
[in]def_valueDefault value if not present.

◆ getValue()

template<class NUMBER>
requires std::derived_from<NUMBER, AbstractNumber>
void ts::hls::TagAttributes::getValue ( NUMBER & val,
const UString & name,
const NUMBER & def_value = NUMBER() ) const
inline

Get the value of an AbstractNumber attribute.

Template Parameters
NUMBERA subclass of AbstractNumber.
Parameters
[out]valDecoded value.
[in]nameAttribute name.
[in]def_valueDefault value if not present.

◆ getMilliValue()

template<typename INT>
requires std::integral<INT>
void ts::hls::TagAttributes::getMilliValue ( INT & val,
const UString & name,
INT def_value = static_cast<INT>(0) ) const
inline

Get the value of a numerical attribute in milli-units.

Template Parameters
INTAn integer type.
Parameters
[out]valDecoded value. If the value is an integer, return this value times 1000. If the value is a decimal one, use 3 decimal digits. Examples: "90" -> 90000, "1.12" -> 1120, "32.1234" -> 32123.
[in]nameAttribute name.
[in]def_valueDefault value if not present.

◆ ToMilliValue() [1/2]

template<typename INT>
requires std::integral<INT>
bool ts::hls::TagAttributes::ToMilliValue ( INT & value,
const UString & str )
inlinestatic

Get the value of a String in milli-units.

Template Parameters
INTAn integer type.
Parameters
[out]valueDecoded value. If the value is an integer, return this value times 1000. If the value is a decimal one, use 3 decimal digits. Examples: "90" -> 90000, "1.12" -> 1120, "32.1234" -> 32123.
[in]strString to decode.
Returns
True on success, false on error.

◆ ToMilliValue() [2/2]

template<class Rep, class Period>
bool ts::hls::TagAttributes::ToMilliValue ( cn::duration< Rep, Period > & value,
const UString & str )
inlinestatic

Get the value of a String in milli-units of a std::chrono::duration type.

Parameters
[out]valueDecoded value. If the value is an integer, return this value times 1000. If the value is a decimal one, use 3 decimal digits. Examples: "90" -> 90000, "1.12" -> 1120, "32.1234" -> 32123.
[in]strString to decode.
Returns
True on success, false on error.

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