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

Attributes of a tag in an HLS playlist. More...

#include <tshlsTagAttributes.h>

Public Member Functions

 TagAttributes (const UString &params=UString())
 Constructor.
 
void clear ()
 Clear the content of the attributes.
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void getIntValue (INT &val, const UString &name, INT defValue=static_cast< INT >(0)) const
 Get the value of an integer attribute.
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void getMilliValue (INT &val, const UString &name, INT defValue=static_cast< INT >(0)) const
 Get the value of a numerical attribute in milli-units.
 
template<class NUMBER , typename std::enable_if< std::is_base_of< AbstractNumber, NUMBER >::value, int >::type = 0>
void getValue (NUMBER &val, const UString &name, const NUMBER &defValue=NUMBER()) const
 Get the value of an AbstractNumber attribute.
 
bool present (const UString &name) const
 Check if an attribute is present.
 
void reload (const UString &params=UString())
 Reload the contents of the attributes.
 
UString value (const UString &name, const UString &defValue=UString()) const
 Get the value of a string attribute.
 

Static Public Member Functions

template<class Rep , class Period >
static bool ToMilliValue (cn::duration< Rep, Period > &value, const UString &str)
 Get the value of a String in milli-units of a std::chrono::duration type.
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
static bool ToMilliValue (INT &value, const UString &str)
 Get the value of a String in milli-units.
 

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.

◆ 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 defValue = UString() 
) const

Get the value of a string attribute.

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

◆ getIntValue()

template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::hls::TagAttributes::getIntValue ( INT val,
const UString name,
INT  defValue = 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]defValueDefault value if not present.

◆ getValue()

template<class NUMBER , typename std::enable_if< std::is_base_of< AbstractNumber, NUMBER >::value, int >::type = 0>
void ts::hls::TagAttributes::getValue ( NUMBER &  val,
const UString name,
const NUMBER &  defValue = NUMBER() 
) const
inline

Get the value of an AbstractNumber attribute.

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

◆ getMilliValue()

template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::hls::TagAttributes::getMilliValue ( INT val,
const UString name,
INT  defValue = 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]defValueDefault value if not present.

◆ ToMilliValue() [1/2]

template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
static 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 >
static 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: