Function isRelativePath

Synopsis

#include <include/fsutil.hpp>

bool isRelativePath(const wstring &path)

Description

TODO: check if find_first_of is necessary or use front()

Source

Lines 69-72 in src/fsutil.cpp. Line 29 in include/fsutil.hpp.

bool fsutil::isRelativePath( const wstring& path ) {
    //return PathIsRelativeW( path.c_str() ); //WinAPI version (requires Shlwapi lib!)
    return path.empty() || ( path.find_first_of( L"/\\" ) != 0 && !( path.length() >= 2 && path[ 1 ] == L':' ) );
}





Add Discussion as Guest

Log in