Ejemplo n.º 1
0
OovString FilePathGetWithoutEndPathSep(
    OovStringRef const path)
{
    OovString str = path;
    FilePathRemovePathSep(str, str.length()-1);
    return str;
}
Ejemplo n.º 2
0
void FilePath::appendFile(OovStringRef const fileName)
{
    OovString fn = fileName;
    if(FilePathIsEndPathSep(pathStdStr()))
    {
        FilePathRemovePathSep(fn, 0);
    }
    pathStdStr().append(fn);
}
Ejemplo n.º 3
0
bool FileIsFileOnDisk(OovStringRef const path, bool &success)
{
    OovString tempPath = path;
    FilePathRemovePathSep(tempPath, tempPath.size()-1);
    struct OovStat32 statval;
    int statRet = OovStat32(tempPath.getStr(), &statval);
    // Indicate there is an error only if the error is not ENOENT.
    success = ((statRet == 0) || (errno == ENOENT));
    // Only indicate the file exists if there was no error, and it is a file.
    return((statRet == 0) && !S_ISDIR(statval.st_mode));
}
Ejemplo n.º 4
0
OovString Project::getSrcRootDirRelativeSrcFileDir(OovStringRef const srcRootDir,
        OovStringRef const srcFileName)
    {
    FilePath relSrcFileDir(srcFileName, FP_Dir);
    size_t pos = relSrcFileDir.find(srcRootDir);
    if(pos != std::string::npos)
        {
        relSrcFileDir.erase(pos, srcRootDir.numBytes());
        FilePathRemovePathSep(relSrcFileDir, 0);
        }
    return relSrcFileDir;
    }
Ejemplo n.º 5
0
OovString Project::getSrcRootDirRelativeSrcFileName(OovStringRef const srcFileName,
        OovStringRef const srcRootDir)
    {
    OovString relSrcFileName = srcFileName;
    size_t pos = relSrcFileName.find(srcRootDir.getStr());
    if(pos != std::string::npos)
        {
        relSrcFileName.erase(pos, srcRootDir.numBytes());
        FilePathRemovePathSep(relSrcFileName, 0);
        }
    return relSrcFileName;
    }
Ejemplo n.º 6
0
void ProjectSettingsDialog::rootSourceDirEntryChanged()
    {
    if(mEditStyle != PS_OpenProjectEditSource)
        {
        GtkEntry *projDirEntry = GTK_ENTRY(Builder::getBuilder()->getWidget(
                "OovaideProjectDirEntry"));

        FilePath rootSrcText(getRootSrcDir(), FP_Dir);
        FilePathRemovePathSep(rootSrcText, rootSrcText.length()-1);
        rootSrcText.appendFile("-oovaide");
        gtk_entry_set_text(projDirEntry, rootSrcText.c_str());
        }
    }