TSDuck Version 3.32-2780 (TSDuck - The MPEG Transport Stream Toolkit)
tsSysUtils.h File Reference

Various system utilities. More...

Classes

struct  ts::ProcessMetrics
 This structure contains metrics about a process. More...
 

Namespaces

 ts
 TSDuck namespace, containing all TSDuck classes and functions.
 

Macros

#define TS_DEFAULT_CSV_SEPARATOR   u","
 Default separator in CSV (comma-separated values) format. More...
 

Typedefs

typedef std::map< UString, UString > ts::Environment
 Define a container type holding all environment variables. More...
 
typedef platform_specific ts::ProcessId
 Integer type for process identifier.
 
typedef platform_specific ts::SysErrorCode
 Integer type for operating system error codes.
 

Functions

UString ts::CallerLibraryFile ()
 Get the name of the executable or shared library file containing the caller code. More...
 
UString ts::ClassName (const std::type_info &info)
 Get the name of a class from the type_info of an object. More...
 
ProcessId ts::CurrentProcessId ()
 Get the current process id. More...
 
bool ts::DeleteEnvironment (const UString &name)
 Delete an environment variable. More...
 
bool ts::EnvironmentExists (const UString &varname)
 Check if an environment variable exists. More...
 
UString ts::ExecutableFile ()
 Get the name of the current application executable file. More...
 
UString ts::ExpandEnvironment (const UString &path)
 Expand environment variables inside a file path (or any string). More...
 
UString ts::GetEnvironment (const UString &varname, const UString &defvalue=UString())
 Get the value of an environment variable. More...
 
void ts::GetEnvironment (Environment &env)
 Get the content of the entire environment (all environment variables). More...
 
template<class CONTAINER >
void ts::GetEnvironmentPath (CONTAINER &container, const UString &name, const UString &def=UString())
 Get the value of an environment variable containing a search path. More...
 
template<class CONTAINER >
void ts::GetEnvironmentPathAppend (CONTAINER &container, const UString &name, const UString &def=UString())
 Get the value of an environment variable containing a search path. More...
 
void ts::GetProcessMetrics (ProcessMetrics &metrics)
 Get metrics for the current process. More...
 
void ts::IgnorePipeSignal ()
 Ensure that writing to a broken pipe does not kill the current process. More...
 
bool ts::IsPrivilegedUser ()
 Check if the current user is privileged (root on UNIX, an administrator on Windows). More...
 
SysErrorCode ts::LastSysErrorCode ()
 Get the error code of the last operating system call. More...
 
bool ts::LoadEnvironment (Environment &env, const UString &fileName)
 Load a text file containing environment variables. More...
 
bool ts::SetBinaryModeStdin (Report &report=(*(static_cast< ts::Report * >(ts::CerrReport::Instance()))))
 Put the standard input stream in binary mode. More...
 
bool ts::SetBinaryModeStdout (Report &report=(*(static_cast< ts::Report * >(ts::CerrReport::Instance()))))
 Put the standard output stream in binary mode. More...
 
bool ts::SetEnvironment (const UString &name, const UString &value)
 Set the value of an environment variable. More...
 
template<class CONTAINER >
void ts::SetEnvironmentPath (const UString &name, const CONTAINER &container)
 Set the value of an environment variable containing a search path. More...
 
void ts::SleepThread (MilliSecond delay)
 Suspend the current thread for the specified period. More...
 
bool ts::StdErrIsTerminal ()
 Check if the standard error is a terminal. More...
 
bool ts::StdInIsTerminal ()
 Check if the standard input is a terminal. More...
 
bool ts::StdOutIsTerminal ()
 Check if the standard output is a terminal. More...
 
UString ts::SysErrorCodeMessage (SysErrorCode code=LastSysErrorCode())
 Format an error code into a string. More...
 

Variables

const char ts::SearchPathSeparator = platform-specific (':', ';')
 Separator character in search paths.
 
const SysErrorCode ts::SYS_DATA_ERROR = platform_specific
 A SysErrorCode value indicating a generic data error. More...
 
const SysErrorCode ts::SYS_SUCCESS = platform_specific
 A SysErrorCode value indicating success. More...
 

Detailed Description

Various system utilities.

Macro Definition Documentation

◆ TS_DEFAULT_CSV_SEPARATOR

#define TS_DEFAULT_CSV_SEPARATOR   u","

Default separator in CSV (comma-separated values) format.

CSV files are suitable for analysis using tools such as Microsoft Excel.