Function dirname

Synopsis

#include <include/fsutil.hpp>

wstring dirname(const wstring &path)

Description

No description yet.

Source

Lines 50-54 in src/fsutil.cpp. Line 39 in include/fsutil.hpp.

wstring fsutil::dirname( const wstring& path ) {
    //the directory containing the path (hence, up directory if the path is a folder)
    size_t pos = path.find_last_of( L"\\/" );
    return ( pos != wstring::npos ) ? path.substr( 0, pos ) : L"";
}





Add Discussion as Guest

Log in