本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: FileRename
void FileRename(OovStringRef const oldPath, OovStringRef const newPath)
{
rename(oldPath.getStr(), newPath.getStr());
}
示例5: FileDelete
void FileDelete(OovStringRef const path)
{
unlink(path.getStr());
}
示例6: FilePathFixFilePath
std::string FilePathFixFilePath(OovStringRef const fullFn)
{
return fullFn.getStr();
}
示例7: FilePathMakeExeFilename
OovString FilePathMakeExeFilename(OovStringRef const rootFn)
{
return rootFn.getStr();
}
示例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);
}
示例9: FileRename
OovStatusReturn FileRename(OovStringRef const oldPath, OovStringRef const newPath)
{
return OovStatus(rename(oldPath.getStr(), newPath.getStr()) == 0, SC_File);
}
示例10: FileDelete
OovStatusReturn FileDelete(OovStringRef const path)
{
return OovStatus(unlink(path.getStr()) == 0 || errno == ENOENT, SC_File);
}
示例11: sendMessage
void OovIpc::sendMessage(OovStringRef msg)
{
printf("%s", msg.getStr());
fflush(stdout);
}