TSDuck v3.43-4509
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches

Representation of a file extracted from a FLUTE stream. More...

#include <tsFluteFile.h>

Inheritance diagram for ts::FluteFile:

Public Member Functions

 FluteFile ()=default
 Default constructor.
 
 FluteFile (const FluteSessionId &sid, uint64_t toi, const UString &name, const UString &type, const ByteBlockPtr &content)
 Constructor.
 
ByteBlockcontent ()
 Access the content of the file (modifiable version).
 
const ByteBlockcontent () const
 Access the content of the file (constant version).
 
bool isValid () const
 Check if the file is valid (for instance is XML content was successfully parsed).
 
const UStringname () const
 Get the name or URN of the file.
 
const FluteSessionIdsessionId () const
 Get the session id of the file.
 
size_t size () const
 Get the size of the file.
 
uint64_t toi () const
 Get the Transport Object Identifier (TOI) of the file.
 
UString toText () const
 Get a character string version of the file, if it is a text file.
 
UString toXML () const
 Get an indented XML character string version of the file, if it is a text file.
 
const UStringtype () const
 Get the MIME type of the file.
 

Protected Member Functions

bool parseXML (xml::Document &xml_doc, const UChar *expected_root=nullptr, bool ignore_namespace=false)
 Parse the document using XML format.
 

Protected Attributes

bool _valid = true
 The validity field can be updated by subclasses.
 

Detailed Description

Representation of a file extracted from a FLUTE stream.

Constructor & Destructor Documentation

◆ FluteFile()

ts::FluteFile::FluteFile ( const FluteSessionId sid,
uint64_t  toi,
const UString name,
const UString type,
const ByteBlockPtr content 
)

Constructor.

Parameters
[in]sidSession id.
[in]toiTransport Object Identifier.
[in]nameFile name or URN.
[in]typeFile MIME type.
[in]contentFile content.

Member Function Documentation

◆ isValid()

bool ts::FluteFile::isValid ( ) const
inline

Check if the file is valid (for instance is XML content was successfully parsed).

Returns
True if the file is valid. False otherwise.

◆ sessionId()

const FluteSessionId & ts::FluteFile::sessionId ( ) const
inline

Get the session id of the file.

Returns
A constant reference to the session in the object.

◆ toi()

uint64_t ts::FluteFile::toi ( ) const
inline

Get the Transport Object Identifier (TOI) of the file.

Returns
The Transport Object Identifier.

◆ name()

const UString & ts::FluteFile::name ( ) const
inline

Get the name or URN of the file.

Returns
A constant reference to the name in the object.

◆ type()

const UString & ts::FluteFile::type ( ) const
inline

Get the MIME type of the file.

Returns
A constant reference to the type string in the object.

◆ size()

size_t ts::FluteFile::size ( ) const
inline

Get the size of the file.

Returns
The size of the file in bytes.

◆ content() [1/2]

ByteBlock & ts::FluteFile::content ( )
inline

Access the content of the file (modifiable version).

Returns
A reference to the content of the file.

◆ content() [2/2]

const ByteBlock & ts::FluteFile::content ( ) const
inline

Access the content of the file (constant version).

Returns
A constant reference to the content of the file.

◆ toText()

UString ts::FluteFile::toText ( ) const

Get a character string version of the file, if it is a text file.

Returns
A string resulting from the conversion of the file content from UTF-8.

◆ toXML()

UString ts::FluteFile::toXML ( ) const

Get an indented XML character string version of the file, if it is a text file.

Returns
A string resulting from the conversion of the file content from UTF-8 and XML reindentation. If the text is not XML, the original text is returned.

◆ parseXML()

bool ts::FluteFile::parseXML ( xml::Document xml_doc,
const UChar expected_root = nullptr,
bool  ignore_namespace = false 
)
protected

Parse the document using XML format.

Parameters
[in,out]xml_docXML document to parse.
[in]expected_rootExpected root name in XML text. Ignored if null or empty.
[in]ignore_namespaceSpecify if XML namespace is ignored by default in this document.
Returns
True on success, false on error.

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