src/libtsduck/base/tsSysUtils.cpp
ts::UString ts::DirectoryName(const UString& path)
{
    UString::size_type sep = LastPathSeparator(path);

    if (sep == NPOS) {
        return u".";               // No '/' in path => current directory
    }
    else if (sep == 0) {
        return path.substr(0, 1);  // '/' at beginning => root
    }
    else {
        return path.substr(0, sep);
    }
}
//----------------------------------------------------------------------------
// Return the directory name of a file path.
//----------------------------------------------------------------------------
Return the directory name of a file path.
Return the directory name of a file path .
ts::UString ts::DirectoryName(const UString& path)
{
    UString::size_type sep = LastPathSeparator(path);
    if (sep == NPOS) {
        return u".";               
    }
    else if (sep == 0) {
        return path.substr(0, 1);  
    }
    else {
        return path.substr(0, sep);
    }
}
ts :: UString ts :: DirectoryName ( const UString & path ) { UString :: size_type sep = LastPathSeparator ( path ) ; if ( sep == NPOS ) { return u" " ; } else if ( sep == 0 ) { return path . substr ( 0 , 1 ) ; } else { return path . substr ( 0 , sep ) ; } }
Return the directory name of a file path.
Return the directory name of a file path .
// No '/' in path => current directory // '/' at beginning => root