src/libtsduck/base/tsSysUtils.cpp
bool ts::IsAbsoluteFilePath(const ts::UString& path)
{
#if defined(TS_WINDOWS)
    return path.startWith(u"\\\\") || (path.length() >= 3 && IsAlpha(path[0]) && path[1] == u':' && path[2] == u'\\');
#else
    return !path.empty() && path[0] == u'/';
#endif
}
//----------------------------------------------------------------------------
// Check if a file path is absolute (starting at a root of a file system).
//----------------------------------------------------------------------------
Check if a file path is absolute (starting at a root of a file system).
Check if a file path is absolute ( starting at a root of a file system ) .
bool ts::IsAbsoluteFilePath(const ts::UString& path)
{
#if defined(TS_WINDOWS)
    return path.startWith(u"\\\\") || (path.length() >= 3 && IsAlpha(path[0]) && path[1] == u':' && path[2] == u'\\');
#else
    return !path.empty() && path[0] == u'/';
#endif
}
bool ts :: IsAbsoluteFilePath ( const ts :: UString & path ) { #if defined ( TS_WINDOWS ) return path . startWith ( u" \\ \\ " ) || ( path . length ( ) >= 3 && IsAlpha ( path [ 0 ] ) && path [ 1 ] == u' ' && path [ 2 ] == u' \\ ' ) ; #else return ! path . empty ( ) && path [ 0 ] == u' ' ; #endif }
Check if a file path is absolute (starting at a root of a file system).
Check if a file path is absolute ( starting at a root of a file system ) .