TSDuck v3.43-4424
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
tsEnvironment.h File Reference

Accessing environment variables. More...

Classes

struct  ts::EnableBitMaskOperators< ts::ExpandOptions >
 Template specialization on type ts::ExpandOptions
More...
 

Namespaces

namespace  ts
 TSDuck namespace, containing all TSDuck classes and functions.
 

Typedefs

using ts::Environment = std::map< UString, UString >
 Define a container type holding all environment variables.
 

Enumerations

enum class  ts::ExpandOptions {
  ts::NONE = 0 ,
  ts::DOLLAR = 0x0001 ,
  ts::BRACES = 0x0002 ,
  ts::ALL = 0xFFFF
}
 Options for expanding environment variables. More...
 

Functions

bool ts::DeleteEnvironment (const UString &name)
 Delete an environment variable.
 
bool ts::EnvironmentExists (const UString &varname)
 Check if an environment variable exists.
 
UString ts::ExpandEnvironment (const UString &path, ExpandOptions options=ExpandOptions::ALL)
 Expand environment variables inside a file path (or any string).
 
UString ts::GetEnvironment (const UString &varname, const UString &defvalue=UString())
 Get the value of an environment variable.
 
void ts::GetEnvironment (Environment &env)
 Get the content of the entire environment (all environment variables).
 
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.
 
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.
 
bool ts::LoadEnvironment (Environment &env, const UString &fileName)
 Load a text file containing environment variables.
 
bool ts::SetEnvironment (const UString &name, const UString &value)
 Set the value of an environment variable.
 
template<class CONTAINER >
void ts::SetEnvironmentPath (const UString &name, const CONTAINER &container)
 Set the value of an environment variable containing a search path.
 

Variables

constexpr const UCharts::PATH_ENVIRONMENT_VARIABLE = platform - specific("PATH", "Path")
 Environment variable containing the command search path.
 
constexpr const UCharts::PLUGINS_PATH_ENVIRONMENT_VARIABLE = u"TSPLUGINS_PATH"
 Name of the environment variable which contains a list of paths for plugins.
 
constexpr UChar ts::SEARCH_PATH_SEPARATOR = platform-specific (':', ';')
 Separator character in search paths.
 

Detailed Description

Accessing environment variables.