当前位置: 首页>>代码示例>>C++>>正文


C++ OovStringRef类代码示例

本文整理汇总了C++中OovStringRef的典型用法代码示例。如果您正苦于以下问题:C++ OovStringRef类的具体用法?C++ OovStringRef怎么用?C++ OovStringRef使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了OovStringRef类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: processFile

// Return true while success.
bool FindFiles::processFile(OovStringRef const filePath)
    {
    bool success = true;
    FilePath ext(filePath, FP_File);

    bool isSource = (isCppHeader(ext) || isCppSource(ext) || isJavaSource(ext));
    if(mSourceFilesOnly ? isSource : true)
        {
        FILE *fp = fopen(filePath.getStr(), "r");
        if(fp)
            {
            char buf[1000];
            int lineNum = 0;
            while(fgets(buf, sizeof(buf), fp))
                {
                lineNum++;
                char const *match=NULL;
                if(mCaseSensitive)
                    {
                    match = strstr(buf, mSrchStr.c_str());
                    }
                else
                    {
                    match = strcasestr(buf, mSrchStr.c_str());
                    }
                if(match)
                    {
                    mNumMatches++;
                    OovString matchStr = filePath;
                    matchStr += ':';
                    matchStr.appendInt(lineNum);
                    matchStr += "   ";
                    matchStr += buf;
//                  matchStr += '\n';
                    Gui::appendText(mView, matchStr);
                    }
                }
            fclose(fp);
            }
        }
    return success;
    }
开发者ID:doniexun,项目名称:oovaide,代码行数:43,代码来源:oovEdit.cpp

示例2: writeFile

bool CMaker::writeFile(OovStringRef const destName, OovStringRef const str)
    {
    bool success = true;
    if(str.numBytes() > 0)
        {
        File file(destName, "w");
        if(file.isOpen())
            {
            success = file.putString("# Generated by oovCMaker\n");
            if(success)
                {
                success = file.putString(str);
                }
            }
        }
    if(!success)
        {
        OovString errStr = "Unable to write file ";
        errStr += destName;
        OovError::report(ET_Error, errStr);
        }
    return success;
    }
开发者ID:8l,项目名称:oovcde,代码行数:23,代码来源:oovCMaker.cpp

示例3: if

enum ComponentTypesFile::eCompTypes ComponentTypesFile::getComponentTypeFromTypeName(
        OovStringRef const compTypeName)
    {
    eCompTypes ct = CT_Unknown;
    if(compTypeName.numBytes() != 0)
        {
        if(compTypeName[0] == 'P')
            ct = CT_Program;
        else if(compTypeName[0] == 'U')
            ct = CT_Unknown;
        else if(compTypeName[1] == 't')
            ct = CT_StaticLib;
        else if(compTypeName[1] == 'h')
            ct = CT_SharedLib;
        else if(compTypeName[0] == 'J')
            {
            if(compTypeName[4] == 'L' || compTypeName[5] == 'L')
                { ct = CT_JavaJarLib; }
            else
                { ct = CT_JavaJarProg; }
            }
        }
    return ct;
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:24,代码来源:Components.cpp

示例4: FileRename

void FileRename(OovStringRef const  oldPath, OovStringRef const  newPath)
{
    rename(oldPath.getStr(), newPath.getStr());
}
开发者ID:8l,项目名称:oovcde,代码行数:4,代码来源:FilePath.cpp

示例5: FileDelete

void FileDelete(OovStringRef const path)
{
    unlink(path.getStr());
}
开发者ID:8l,项目名称:oovcde,代码行数:4,代码来源:FilePath.cpp

示例6: FilePathFixFilePath

std::string FilePathFixFilePath(OovStringRef const fullFn)
{
    return fullFn.getStr();
}
开发者ID:8l,项目名称:oovcde,代码行数:4,代码来源:FilePath.cpp

示例7: FilePathMakeExeFilename

OovString FilePathMakeExeFilename(OovStringRef const  rootFn)
{
    return rootFn.getStr();
}
开发者ID:8l,项目名称:oovcde,代码行数:4,代码来源:FilePath.cpp

示例8: makeComponentFile

void CMaker::makeComponentFile(OovStringRef const compName,
    ComponentTypesFile::eCompTypes compType,
    OovStringVec const &sources, OovStringRef const destName)
    {
    OovString str;
    if(mVerbose)
        printf("Processing %s\n      %s\n", compName.getStr(), destName.getStr());
    if(compType == ComponentTypesFile::CT_Program)
        {
        if(mVerbose)
            printf("  Executable\n");

        addCommandAndNames(CT_Exec, compName, sources, str);

        addLibsAndIncs(compName, str);

        str += "install(TARGETS ";
        str += compName;
        str += "\n  EXPORT ";
        str += mProjectName;
        str += "Targets";
        str += "\n  RUNTIME DESTINATION \"${INSTALL_BIN_DIR}\" COMPONENT lib)\n";
        }
    else if(compType == ComponentTypesFile::CT_SharedLib)
        {
        if(mVerbose)
            printf("  SharedLib\n");
        addCommandAndNames(CT_Shared, compName, sources, str);

        addLibsAndIncs(compName, str);

        str += "install(TARGETS ";
        str += compName;
        str += "\n  LIBRARY DESTINATION \"${INSTALL_LIB_DIR}\" COMPONENT lib)\n";
        }
    else if(compType == ComponentTypesFile::CT_StaticLib)
        {
        if(mVerbose)
            printf("  Library\n");
        OovStringVec headers = mCompTypes.getComponentIncludes(compName);
        discardDirs(headers);

        OovStringVec allFiles = headers;
        allFiles.insert(allFiles.end(), sources.begin(), sources.end() );
        std::sort(allFiles.begin(), allFiles.end(), compareNoCase);
        if(sources.size() == 0)
            {
            addCommandAndNames(CT_Interface, compName, allFiles, str);
            str += "set_target_properties(";
            str += compName;
            str += " PROPERTIES LINKER_LANGUAGE CXX)\n";
            }
        else
            addCommandAndNames(CT_Static, compName, allFiles, str);

        addCommandAndNames(CT_TargHeaders, compName, headers, str);


        str += "install(TARGETS ";
        str += compName;
        str += "\n  EXPORT ";
        str += mProjectName;
        str += "Targets";
        str += "\n  ARCHIVE DESTINATION \"${INSTALL_LIB_DIR}\" COMPONENT lib";
        str += "\n  PUBLIC_HEADER DESTINATION \"${INSTALL_INCLUDE_DIR}/";
        str += mProjectName;
        str += "\" COMPONENT dev)\n";
        }
    writeFile(destName, str);
    }
开发者ID:8l,项目名称:oovcde,代码行数:70,代码来源:oovCMaker.cpp

示例9: FileRename

OovStatusReturn FileRename(OovStringRef const  oldPath, OovStringRef const  newPath)
    {
    return OovStatus(rename(oldPath.getStr(), newPath.getStr()) == 0, SC_File);
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:4,代码来源:FilePath.cpp

示例10: FileDelete

OovStatusReturn FileDelete(OovStringRef const path)
    {
    return OovStatus(unlink(path.getStr()) == 0 || errno == ENOENT, SC_File);
    }
开发者ID:Purplenigma,项目名称:oovaide,代码行数:4,代码来源:FilePath.cpp

示例11: sendMessage

void OovIpc::sendMessage(OovStringRef msg)
    {
    printf("%s", msg.getStr());
    fflush(stdout);
    }
开发者ID:8l,项目名称:oovcde,代码行数:5,代码来源:OovIpc.cpp


注:本文中的OovStringRef类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。