TSDuck v3.46-4930
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
Applications

Application management tools. More...

Collaboration diagram for Applications:

Classes

class  ts::ConfigFile
class  ts::ConfigSection
class  ts::DuckConfigFile
class  ts::DuckContext
class  ts::EditLine
class  ts::Features
class  ts::GitHubRelease
class  ts::IPArgs
class  ts::Names
class  ts::RestArgs
class  ts::RestClient
class  ts::RestServer
class  ts::TLSArgs
class  ts::VersionInfo

Macros

#define TS_COMMIT   4930
#define TS_FATAL(literal)
#define TS_FATALMSG(literal)
#define TS_MAIN(func)
#define TS_VERSION_INTEGER   ((TS_VERSION_MAJOR * 10000000) + (TS_VERSION_MINOR * 100000) + TS_COMMIT)
#define TS_VERSION_MAJOR   3
#define TS_VERSION_MINOR   46
#define TS_VERSION_STRING   TS_STRINGIFY(TS_VERSION_MAJOR) "." TS_STRINGIFY(TS_VERSION_MINOR) "-" TS_STRINGIFY(TS_COMMIT)
#define TS_VERSION_USTRING   TS_USTRINGIFY(TS_VERSION_MAJOR) u"." TS_USTRINGIFY(TS_VERSION_MINOR) u"-" TS_USTRINGIFY(TS_COMMIT)

Typedefs

using ts::GitHubReleasePtr = std::shared_ptr<GitHubRelease>
using ts::GitHubReleaseVector = std::vector<GitHubReleasePtr>
using ts::NamesPtr = std::shared_ptr<Names>

Enumerations

enum class  ts::NamesFlags : uint16_t {
  ts::NamesFlags::NAME = 0x0000 ,
  ts::NamesFlags::NAME_VALUE = 0x0001 ,
  ts::NamesFlags::VALUE_NAME = 0x0002 ,
  ts::NamesFlags::HEXA = 0x0004 ,
  ts::NamesFlags::DECIMAL = 0x0008 ,
  ts::NamesFlags::ALTERNATE = 0x0010 ,
  ts::NamesFlags::NAME_OR_VALUE = 0x0020 ,
  ts::NamesFlags::NO_UNKNOWN = 0x0040 ,
  ts::NamesFlags::HEX_DEC = HEXA | DECIMAL ,
  ts::NamesFlags::HEX_VALUE_NAME = VALUE_NAME | HEXA ,
  ts::NamesFlags::DEC_VALUE_NAME = VALUE_NAME | DECIMAL ,
  ts::NamesFlags::HEX_DEC_VALUE_NAME = VALUE_NAME | HEXA | DECIMAL
}

Functions

void ts::FatalError (const char *message, size_t length)
int MainWrapper (int(*func)(int argc, char *argv[]), int argc, _TS_ARGV_TYPE *argv[])

Detailed Description

Application management tools.

Macro Definition Documentation

◆ TS_VERSION_STRING

Define the TSDuck version as an 8-bit string literal.

◆ TS_VERSION_USTRING

#define TS_VERSION_USTRING   TS_USTRINGIFY(TS_VERSION_MAJOR) u"." TS_USTRINGIFY(TS_VERSION_MINOR) u"-" TS_USTRINGIFY(TS_COMMIT)

Define the TSDuck version as a 16-bit string literal.

◆ TS_VERSION_INTEGER

#define TS_VERSION_INTEGER   ((TS_VERSION_MAJOR * 10000000) + (TS_VERSION_MINOR * 100000) + TS_COMMIT)

Define the TSDuck version as an integer, suitable for comparisons.

◆ TS_MAIN

#define TS_MAIN ( func)

A macro which expands to a main() program. An explicit reference is made to the TSDuck library version to check that the compilation and runtime versions are identical.

Parameters
funcThe actual main function with the same profile as main().

◆ TS_FATALMSG

#define TS_FATALMSG ( literal)
Value:
"\n\n*** " literal ", aborting...\n\n"

Build a string literal for fatal error messages.

Parameters
literal8-bit string literal

◆ TS_FATAL

#define TS_FATAL ( literal)

Abort the application with a fatal error message.

Parameters
literal8-bit string literal error message.
See also
ts::FatalError

◆ TS_VERSION_MAJOR

#define TS_VERSION_MAJOR   3

TSDuck major version.

◆ TS_VERSION_MINOR

#define TS_VERSION_MINOR   46

TSDuck minor version.

◆ TS_COMMIT

#define TS_COMMIT   4930

TSDuck commit number (automatically updated by Git hooks).

Typedef Documentation

◆ GitHubReleasePtr

using ts::GitHubReleasePtr = std::shared_ptr<GitHubRelease>

Smart pointer to a GitHubRelease (not thread-safe).

◆ GitHubReleaseVector

Vector of smart pointers to GitHubRelease objects.

◆ NamesPtr

using ts::NamesPtr = std::shared_ptr<Names>

Safe pointer for Names.

Enumeration Type Documentation

◆ NamesFlags

enum class ts::NamesFlags : uint16_t
strong

Flags to be used in the formating of names using class Names. Values can be used as bit-masks.

Enumerator
NAME 

Name only, no value. This is the default.

NAME_VALUE 

Include the value after name: "name (value)".

VALUE_NAME 

Same with value first: "value (name)".

HEXA 

Value in hexadecimal. This is the default.

DECIMAL 

Value in decimal. Both DECIMAL and HEXA can be specified.

ALTERNATE 

Display an alternate integer value.

NAME_OR_VALUE 

Display name if defined or value only if not defined.

NO_UNKNOWN 

Ignore unknown values, return an empty string.

HEX_DEC 

Value in decimal and hexadecimal.

HEX_VALUE_NAME 

Value in hexadecimal in first position.

DEC_VALUE_NAME 

Value in decimal in first position.

HEX_DEC_VALUE_NAME 

Value in decimal and hexadecimal in first position.

Function Documentation

◆ MainWrapper()

int MainWrapper ( int(* func )(int argc, char *argv[]),
int argc,
_TS_ARGV_TYPE * argv[] )

A function to wrap the entry point of an application.

The application code should use the macro TS_MAIN instead of directly calling this function.

Uncaught exceptions are displayed.

Windows specificities

The COM environment and IP networking are initialized.

The Windows console is set to UTF-8 mode and restored to its previous value on exit.

The entry point is defined as wmain() instead of main() in macro TS_MAIN to capture UTF-16 characters from the command line. This is a workaround for another Windows oddity. On Windows, unlike any modern operating system, when main() is used, any non-ASCII character from the command line is converted to '?' instead of converting all strings to UTF-8. We need to use wmain() to get UTF-16 characters. In MainWrapper(), we convert UTF-16 characters from the command line into UTF-8 to be compatible with the classical main() UTF-8 profile. In that case, there is a double conversion, first from UTF-16 to UTF-8 in MainWrapper(), then back from UTF-8 to UTF-16 inside the application, typically in class Args. This is silly but an operating not working in UTF-8 is silly...

Parameters
[in]funcThe actual main function with the same profile as main().
[in]argcCommand line parameter count.
[in]argvCommand line parameters.
Returns
The process exit code, typically EXIT_SUCCESS or EXIT_FAILURE.

◆ FatalError()

void ts::FatalError ( const char * message,
size_t length )

Handle a fatal error. An emergency message is output and the application is terminated.

Parameters
[in]messageAddress of an emergency error message to output.
[in]lengthLength of message. The caller must specify length in a static way. In that kind of fatal error, we can't even dare to call strlen().