![]() |
TSDuck v3.40-4161
MPEG Transport Stream Toolkit
|
Application management tools. More...
Classes | |
class | ts::ConfigFile |
Representation of a configuration file. More... | |
class | ts::ConfigSection |
Representation of a "configuration section". More... | |
class | ts::DuckConfigFile |
A singleton which contains the TSDuck configuration file. More... | |
class | ts::DuckContext |
TSDuck execution context containing current preferences. More... | |
class | ts::EditLine |
Read input lines with bash-like line editing when possible. More... | |
class | ts::GitHubRelease |
This class holds information from GitHub about a release of a project. More... | |
class | ts::Names |
Representation of a set of translations between names for identifiers. More... | |
class | ts::VersionInfo |
Information about version identification of TSDuck. More... | |
Macros | |
#define | TS_COMMIT 4161 |
TSDuck commit number (automatically updated by Git hooks). | |
#define | TS_FATAL(literal) |
Abort the application with a fatal error message. | |
#define | TS_FATALMSG(literal) "\n\n*** " literal ", aborting...\n\n" |
Build a string literal for fatal error messages. | |
#define | TS_MAIN(func) |
A macro which expands to a main() program. | |
#define | TS_VERSION_INTEGER ((TS_VERSION_MAJOR * 10000000) + (TS_VERSION_MINOR * 100000) + TS_COMMIT) |
Define the TSDuck version as an integer, suitable for comparisons. | |
#define | TS_VERSION_MAJOR 3 |
TSDuck major version. | |
#define | TS_VERSION_MINOR 40 |
TSDuck minor version. | |
#define | TS_VERSION_STRING TS_STRINGIFY(TS_VERSION_MAJOR) "." TS_STRINGIFY(TS_VERSION_MINOR) "-" TS_STRINGIFY(TS_COMMIT) |
Define the TSDuck version as an 8-bit string literal. | |
#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. | |
Typedefs | |
using | ts::GitHubReleasePtr = std::shared_ptr< GitHubRelease > |
Smart pointer to a GitHubRelease (not thread-safe). | |
using | ts::GitHubReleaseVector = std::vector< GitHubReleasePtr > |
Vector of smart pointers to GitHubRelease objects. | |
using | ts::NamesPtr = std::shared_ptr< Names > |
Safe pointer for 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 } |
Flags to be used in the formating of names using class Names. More... | |
Functions | |
void | ts::CheckNonNull (const void *ptr) |
Check the value of a pointer and abort the application when zero. | |
void | ts::FatalError (const char *message, size_t length) |
Handle a fatal error. | |
void | ts::FatalMemoryAllocation () |
Handle fatal memory allocation failure. | |
int | MainWrapper (int(*func)(int argc, char *argv[]), int argc, char *argv[]) |
A function to wrap the entry point of an application. | |
Application management tools.
#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.
func | The actual main function with the same profile as main(). |
#define TS_FATALMSG | ( | literal | ) | "\n\n*** " literal ", aborting...\n\n" |
Build a string literal for fatal error messages.
literal | 8-bit string literal |
#define TS_FATAL | ( | literal | ) |
Abort the application with a fatal error message.
literal | 8-bit string literal error message. |
|
strong |
Flags to be used in the formating of names using class Names.
Values can be used as bit-masks.
int MainWrapper | ( | int(*)(int argc, char *argv[]) | func, |
int | argc, | ||
char * | 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. On Windows, 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.
[in] | func | The actual main function with the same profile as main(). |
[in] | argc | Command line parameter count. |
[in] | argv | Command line parameters. |
void ts::FatalError | ( | const char * | message, |
size_t | length | ||
) |
Handle a fatal error.
An emergency message is output and the application is terminated.
[in] | message | Address of an emergency error message to output. |
[in] | length | Length 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(). |
void ts::FatalMemoryAllocation | ( | ) |
Handle fatal memory allocation failure.
Out of virtual memory, very dangerous situation, really can't recover from that, need to abort immediately. An emergency error message is output and the application is terminated.
|
inline |
Check the value of a pointer and abort the application when zero.
This function is typically after a new.
[in] | ptr | The pointer to check. |