TSDuck v3.40-4033
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::SimulCryptDate Class Reference

Representation of a date in DVB SimulCrypt protocols (ETSI TS 103 197). More...

#include <tsSimulCryptDate.h>

Public Member Functions

 SimulCryptDate ()
 Default constructor.
 
 SimulCryptDate (const Time &time)
 Constructor from a ts::Time.
 
 SimulCryptDate (const void *bin)
 Constructor from binary data.
 
 SimulCryptDate (int year, int month, int day, int hour, int minute, int second, int hundredth)
 Constructor from broken-down date fields.
 
int day () const
 Get the number of days.
 
void get (const tlv::MessageFactory &factory, tlv::TAG tag)
 Get from a DVB SimulCrypt TLV messages.
 
void getBinary (const void *a)
 Read from memory (8 bytes).
 
int hour () const
 Get the number of hours.
 
int hundredth () const
 Get the number of hundredths of seconds.
 
int minute () const
 Get the number of minutes.
 
int month () const
 Get the number of months.
 
 operator Time () const
 Convert to a Time object.
 
 operator UString () const
 Convert to a string object.
 
void put (tlv::Serializer &zer) const
 Put into a DVB SimulCrypt TLV messages.
 
void put (tlv::Serializer &zer, tlv::TAG tag) const
 Put as a complete TLV structure into a DVB SimulCrypt TLV messages.
 
void putBinary (void *a) const
 Write to memory (8 bytes).
 
void reset ()
 Reset to a null value.
 
int second () const
 Get the number of seconds.
 
void setDay (int n)
 Set the number of days.
 
void setHour (int n)
 Set the number of hours.
 
void setHundredth (int n)
 Set the number of hundredths of seconds.
 
void setMinute (int n)
 Set the number of minutes.
 
void setMonth (int n)
 Set the number of months.
 
void setSecond (int n)
 Set the number of seconds.
 
void setYear (int n)
 Set the number of years.
 
int year () const
 Get the number of years.
 

Static Public Attributes

static constexpr size_t SIZE = 8
 Binary size in bytes of a DVB SimulCrypt date.
 

Detailed Description

Representation of a date in DVB SimulCrypt protocols (ETSI TS 103 197).

A DVB SimulCrypt date is represented on 8 bytes:

  • year: 2 bytes
  • month: 1 byte
  • day: 1 byte
  • hour: 1 byte
  • minute: 1 byte
  • second: 1 byte
  • hundredth: 1 byte

Constructor & Destructor Documentation

◆ SimulCryptDate() [1/3]

ts::SimulCryptDate::SimulCryptDate ( const void *  bin)
inline

Constructor from binary data.

Parameters
[in]binAddress of an 8-byte binary DVB SimulCrypt date.

◆ SimulCryptDate() [2/3]

ts::SimulCryptDate::SimulCryptDate ( const Time time)

Constructor from a ts::Time.

Parameters
[in]timeTime value to set.

◆ SimulCryptDate() [3/3]

ts::SimulCryptDate::SimulCryptDate ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second,
int  hundredth 
)

Constructor from broken-down date fields.

Parameters
[in]yearNumber of years.
[in]monthNumber of months (1 to 12).
[in]dayNumber of days (1 to 31).
[in]hourNumber of hours (0 to 23).
[in]minuteNumber of minutes (0 to 59).
[in]secondNumber of seconds (0 to 59).
[in]hundredthNumber of hundredths of seconds (0 to 99).

Member Function Documentation

◆ year()

int ts::SimulCryptDate::year ( ) const
inline

Get the number of years.

Returns
The number of years.

◆ month()

int ts::SimulCryptDate::month ( ) const
inline

Get the number of months.

Returns
The number of months.

◆ day()

int ts::SimulCryptDate::day ( ) const
inline

Get the number of days.

Returns
The number of days.

◆ hour()

int ts::SimulCryptDate::hour ( ) const
inline

Get the number of hours.

Returns
The number of hours.

◆ minute()

int ts::SimulCryptDate::minute ( ) const
inline

Get the number of minutes.

Returns
The number of minutes.

◆ second()

int ts::SimulCryptDate::second ( ) const
inline

Get the number of seconds.

Returns
The number of seconds.

◆ hundredth()

int ts::SimulCryptDate::hundredth ( ) const
inline

Get the number of hundredths of seconds.

Returns
The number of hundredths of seconds.

◆ setYear()

void ts::SimulCryptDate::setYear ( int  n)
inline

Set the number of years.

Parameters
[in]nThe number of years.

◆ setMonth()

void ts::SimulCryptDate::setMonth ( int  n)
inline

Set the number of months.

Parameters
[in]nThe number of months.

◆ setDay()

void ts::SimulCryptDate::setDay ( int  n)
inline

Set the number of days.

Parameters
[in]nThe number of days.

◆ setHour()

void ts::SimulCryptDate::setHour ( int  n)
inline

Set the number of hours.

Parameters
[in]nThe number of hours.

◆ setMinute()

void ts::SimulCryptDate::setMinute ( int  n)
inline

Set the number of minutes.

Parameters
[in]nThe number of minutes.

◆ setSecond()

void ts::SimulCryptDate::setSecond ( int  n)
inline

Set the number of seconds.

Parameters
[in]nThe number of seconds.

◆ setHundredth()

void ts::SimulCryptDate::setHundredth ( int  n)
inline

Set the number of hundredths of seconds.

Parameters
[in]nThe number of hundredths of seconds.

◆ getBinary()

void ts::SimulCryptDate::getBinary ( const void *  a)
inline

Read from memory (8 bytes).

Parameters
[in]aAddress of an 8-byte binary DVB SimulCrypt date.

◆ putBinary()

void ts::SimulCryptDate::putBinary ( void *  a) const
inline

Write to memory (8 bytes).

Parameters
[out]aAddress of an 8-byte buffer for the binary DVB SimulCrypt date.

◆ put() [1/2]

void ts::SimulCryptDate::put ( tlv::Serializer zer) const
inline

Put into a DVB SimulCrypt TLV messages.

Parameters
[in,out]zerA TLV serializer.

◆ put() [2/2]

void ts::SimulCryptDate::put ( tlv::Serializer zer,
tlv::TAG  tag 
) const
inline

Put as a complete TLV structure into a DVB SimulCrypt TLV messages.

Parameters
[in,out]zerA TLV serializer.
[in]tagTag for the date parameter.

◆ get()

void ts::SimulCryptDate::get ( const tlv::MessageFactory factory,
tlv::TAG  tag 
)

Get from a DVB SimulCrypt TLV messages.

Parameters
[in,out]factoryA TLV message factory.
[in]tagTag for the date parameter.
Exceptions
ts::tlv::DeserializationInternalErrorif not found.

◆ operator Time()

ts::SimulCryptDate::operator Time ( ) const

Convert to a Time object.

Returns
The equivalent ts::Time object.

◆ operator UString()

ts::SimulCryptDate::operator UString ( ) const

Convert to a string object.

Returns
The equivalent string.

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