예제 #1
0
파일: editor.cpp 프로젝트: CruzR/stk-editor
// ----------------------------------------------------------------------------
stringc Editor::getLib(stringc s)
{
    u32 ix;
    ix = s.findLast('/');
    s = s.subString(0, ix);
    ix = s.findLast('/');
    s = s.subString(ix + 1, s.size() - ix - 1);
    return s;
} // getLib
예제 #2
0
파일: TScript.cpp 프로젝트: bdbdonp/tubras
    //-------------------------------------------------------------------------
    //                         _ e x t r a c t D i r 
    //-------------------------------------------------------------------------
    stringc _extractDir(stringc filename)
    {
        stringc result="";
        // find last forward or backslash
        s32 lastSlash = filename.findLast('/');
        const s32 lastBackSlash = filename.findLast('\\');
        lastSlash = lastSlash > lastBackSlash ? lastSlash : lastBackSlash;

        if ((u32)lastSlash < filename.size())
            return filename.subString(0, lastSlash+1);
        else
            return ".";
    }