TSDuck v3.40-3963
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
tsFileUtils.h File Reference

File utilities (file path, file properties, etc). More...

Namespaces

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

Functions

UString ts::AbsoluteFilePath (const UString &path, const UString &base=UString())
 Build the absolute form of a file path.
 
UString ts::BaseName (const UString &path, const UString &suffix=UString())
 Return the base file name of a file path ("dir/foo.bar" => "foo.bar").
 
UString ts::CleanupFilePath (const UString &path)
 Cleanup a file path.
 
UString ts::DirectoryName (const UString &path)
 Return the directory name of a file path ("dir/foo.bar" => "dir").
 
template<class CONTAINER >
bool ts::ExpandWildcard (CONTAINER &container, const UString &pattern)
 Get all files matching a specified wildcard pattern.
 
template<class CONTAINER >
bool ts::ExpandWildcardAndAppend (CONTAINER &container, const UString &pattern)
 Get all files matching a specified wildcard pattern and append them into a container.
 
Time ts::GetFileModificationTimeLocal (const UString &path)
 Get the local time of the last modification of a file.
 
Time ts::GetFileModificationTimeUTC (const UString &path)
 Get the UTC time of the last modification of a file.
 
bool ts::IsAbsoluteFilePath (const UString &path)
 Check if a file path is absolute (starting at a root of a file system).
 
UString ts::RelativeFilePath (const UString &path, const UString &base=UString(), CaseSensitivity caseSensitivity=FILE_SYSTEM_CASE_SENSITVITY, bool portableSlashes=false)
 Build a relative form of a file path, relative to a base directory.
 
UString ts::SearchConfigurationFile (const UString &fileName)
 Search a configuration file.
 
UString ts::SearchExecutableFile (const UString &fileName, const UString &pathName=PATH_ENVIRONMENT_VARIABLE)
 Search an executable file.
 
template<class CONTAINER >
bool ts::SearchWildcard (CONTAINER &container, const UString &root, const UString &pattern, size_t max_levels=64, bool skip_symlinks=true)
 Search all files matching a specified wildcard pattern in a directory tree.
 
template<class CONTAINER >
bool ts::SearchWildcardAndAppend (CONTAINER &container, const UString &root, const UString &pattern, size_t max_levels=64, bool skip_symlinks=true)
 Search all files matching a specified wildcard pattern in a directory tree and append them into a container.
 
fs::path ts::TempFile (const UString &suffix=u".tmp")
 Return the name of a unique temporary file.
 
UString ts::UserConfigurationFileName (const UString &fileName, const UString &winFileName=UString())
 Build the name of a user-specific configuration file.
 
fs::path ts::UserHomeDirectory ()
 Get the current user's home directory.
 
UString ts::VernacularFilePath (const UString &path)
 Return a "vernacular" version of a file path.
 

Variables

constexpr const UCharts::DEFAULT_CSV_SEPARATOR = u","
 Default separator in CSV (comma-separated values) format.
 
constexpr const UCharts::EXECUTABLE_FILE_SUFFIX = platform - specific(".exe", "")
 Executable file suffix.
 
constexpr CaseSensitivity ts::FILE_SYSTEM_CASE_SENSITVITY = platform-specific
 Case-sensitivity of the names in the file system.
 
constexpr const UCharts::SHARED_LIBRARY_SUFFIX = platform - specific(".dll", ".so", ".dylib")
 File name extension of shared library file names (".so" on Linux, '.dylib" on macOS, ".dll" on Windows).
 

Detailed Description

File utilities (file path, file properties, etc).