sample/sample-extension/src/fooCAS.cpp
ts::UString foo::LogFooCASECM(const ts::Section& section, size_t max_bytes)
{
    const uint8_t* data = section.payload();
    size_t size = section.payloadSize();

    // A FooCAS ECM starts with a 2-byte foo_id.
    return size < 2 ? ts::UString() : ts::UString::Format(u"Foo id: 0x%X, data: %s", {ts::GetUInt16(data), ts::UString::Dump(data + 2, std::min(max_bytes, size - 2), ts::UString::COMPACT)});
}
//----------------------------------------------------------------------------
// Display the payload of a FooCAS ECM as a one-line "log" message.
//----------------------------------------------------------------------------
Display the payload of a FooCAS ECM as a one-line "log" message.
Display the payload of a FooCAS ECM as a one - line " log " message .
ts::UString foo::LogFooCASECM(const ts::Section& section, size_t max_bytes)
{
    const uint8_t* data = section.payload();
    size_t size = section.payloadSize();
    return size < 2 ? ts::UString() : ts::UString::Format(u"Foo id: 0x%X, data: %s", {ts::GetUInt16(data), ts::UString::Dump(data + 2, std::min(max_bytes, size - 2), ts::UString::COMPACT)});
}
ts :: UString foo :: LogFooCASECM ( const ts :: Section & section , size_t max_bytes ) { const uint8_t * data = section . payload ( ) ; size_t size = section . payloadSize ( ) ; return size < 2 ? ts :: UString ( ) : ts :: UString :: Format ( u" " , { ts :: GetUInt16 ( data ) , ts :: UString :: Dump ( data + 2 , std :: min ( max_bytes , size - 2 ) , ts :: UString :: COMPACT ) } ) ; }
Display the payload of a FooCAS ECM as a one-line "log" message.
Display the payload of a FooCAS ECM as a one - line " log " message .
// A FooCAS ECM starts with a 2-byte foo_id.