Attributes of a tag in an HLS playlist.
More...
#include <tshlsTagAttributes.h>
|
| TagAttributes (const UString ¶ms=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 ¶ms=UString()) |
| Reload the contents of the attributes.
|
|
UString | value (const UString &name, const UString &defValue=UString()) const |
| Get the value of a string attribute.
|
|
|
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.
|
|
Attributes of a tag in an HLS playlist.
◆ TagAttributes()
ts::hls::TagAttributes::TagAttributes |
( |
const UString & |
params = UString() | ) |
|
Constructor.
- Parameters
-
[in] | params | String parameter of the tag in the playlist line. |
◆ reload()
void ts::hls::TagAttributes::reload |
( |
const UString & |
params = UString() | ) |
|
Reload the contents of the attributes.
- Parameters
-
[in] | params | String 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
-
- Returns
- True if the attribute is present.
◆ value()
Get the value of a string attribute.
- Parameters
-
[in] | name | Attribute name. |
[in] | defValue | Default 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
-
- Parameters
-
[out] | val | Decoded value. |
[in] | name | Attribute name. |
[in] | defValue | Default 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
-
- Parameters
-
[out] | val | Decoded value. |
[in] | name | Attribute name. |
[in] | defValue | Default 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
-
- Parameters
-
[out] | val | Decoded 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] | name | Attribute name. |
[in] | defValue | Default 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
-
- Parameters
-
[out] | value | Decoded 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] | str | String 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] | value | Decoded 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] | str | String to decode. |
- Returns
- True on success, false on error.
The documentation for this class was generated from the following file: