src/libtsduck/base/tsSysUtils.cpp
ts::UString ts::AddPathSuffix(const UString& path, const UString& suffix)
{
    UString::size_type sep = LastPathSeparator(path);
    UString::size_type dot = path.rfind(u'.');

    if (dot == NPOS || (sep != NPOS && dot < sep)) {
        return path + suffix;
    }
    else {
        return path;
    }
}
//----------------------------------------------------------------------------
// If the file path does not contain a suffix, add the specified one.
// Otherwise, return the name unchanged.
//----------------------------------------------------------------------------
If the file path does not contain a suffix, add the specified one.
Otherwise, return the name unchanged.
If the file path does not contain a suffix add the specified one . Otherwise return the name unchanged .
ts::UString ts::AddPathSuffix(const UString& path, const UString& suffix)
{
    UString::size_type sep = LastPathSeparator(path);
    UString::size_type dot = path.rfind(u'.');
    if (dot == NPOS || (sep != NPOS && dot < sep)) {
        return path + suffix;
    }
    else {
        return path;
    }
}
ts :: UString ts :: AddPathSuffix ( const UString & path , const UString & suffix ) { UString :: size_type sep = LastPathSeparator ( path ) ; UString :: size_type dot = path . rfind ( u' ' ) ; if ( dot == NPOS || ( sep != NPOS && dot < sep ) ) { return path + suffix ; } else { return path ; } }
If the file path does not contain a suffix, add the specified one.
If the file path does not contain a suffix add the specified one .