本文整理汇总了C++中OovStringRef::getStr方法的典型用法代码示例。如果您正苦于以下问题:C++ OovStringRef::getStr方法的具体用法?C++ OovStringRef::getStr怎么用?C++ OovStringRef::getStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OovStringRef
的用法示例。
在下文中一共展示了OovStringRef::getStr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkAttrUsed
bool ModelStatements::checkAttrUsed(ModelClassifier const *cls,
OovStringRef attrName) const
{
bool used = false;
for(auto const &stmt : *this)
{
ModelType const *modelType = stmt.getClassDecl().getDeclType();
ModelClassifier const *classifier = ModelType::getClass(modelType);
if(cls == classifier)
{
eModelStatementTypes stateType = stmt.getStatementType();
if(stateType == ST_VarRef)
{
if(stmt.getAttrName() == attrName.getStr())
{
used = true;
break;
}
}
else if(stateType == ST_Call)
{
if(stmt.getAttrName() == attrName.getStr())
{
used = true;
break;
}
}
}
}
return used;
}
示例2: FileMakeSubDir
OovStatusReturn FileMakeSubDir(OovStringRef partPath)
{
#ifdef __linux__
bool success = (mkdir(partPath.getStr(), 0x1FF) == 0); // 0777
#else
bool success = (_mkdir(partPath.getStr()) == 0);
#endif
return(OovStatus(success, SC_File));
}
示例3: FileGetFileTime
OovStatusReturn FileGetFileTime(OovStringRef const path, time_t &time)
{
struct OovStat32 srcFileStat;
OovStatus status(OovStat32(path.getStr(), &srcFileStat) == 0, SC_File);
if(status.ok())
time = srcFileStat.st_mtime;
return status;
}
示例4: FileGetFileTime
bool FileGetFileTime(OovStringRef const path, time_t &time)
{
struct OovStat32 srcFileStat;
bool success = (OovStat32(path.getStr(), &srcFileStat) == 0);
if(success)
time = srcFileStat.st_mtime;
return success;
}
示例5: switch
Visibility::Visibility(OovStringRef const umlStr)
{
switch(umlStr.getStr()[0])
{
default: // fall through
case '+': vis = Visibility::Public; break;
case '#': vis = Visibility::Protected; break;
case '-': vis = Visibility::Private; break;
}
}
示例6: addPackageDefines
void CMaker::addPackageDefines(OovStringRef const pkgName, std::string &str)
{
OovString pkgDefName;
makeDefineName(pkgName, pkgDefName);
str += std::string("# ") + pkgDefName + "\n";
str += std::string("pkg_check_modules(") + pkgDefName + " REQUIRED " +
pkgName.getStr() + ")\n";
str += std::string("include_directories(${") + pkgDefName + "_INCLUDE_DIRS})\n";
str += std::string("link_directories(${") + pkgDefName + "_LIBRARY_DIRS})\n";
str += std::string("add_definitions(${") + pkgDefName + "_CFLAGS_OTHER})\n";
}
示例7: getSrcRootDirRelativeSrcFileName
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;
}
示例8: FilePathGetPosStartDir
size_t FilePathGetPosStartDir(OovStringRef const path)
{
size_t pos = std::string(path.getStr()).rfind(':');
if(pos == std::string::npos)
{
pos = 0;
}
else
{
pos++;
}
return pos;
}
示例9: replaceStrs
bool OovString::replaceStrs(OovStringRef const srchStr, OovStringRef const repStr)
{
size_t starti = 0;
bool didReplace = false;
do
{
starti = find(srchStr, starti);
if(starti != OovString::npos)
{
didReplace = true;
std::string::replace(starti, strlen(srchStr), repStr);
starti+=strlen(repStr.getStr());
}
} while(starti != OovString::npos);
return didReplace;
}
示例10: 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;
}
示例11: sendMessage
void OovIpc::sendMessage(OovStringRef msg)
{
printf("%s", msg.getStr());
fflush(stdout);
}
示例12: FileRename
OovStatusReturn FileRename(OovStringRef const oldPath, OovStringRef const newPath)
{
return OovStatus(rename(oldPath.getStr(), newPath.getStr()) == 0, SC_File);
}
示例13: FileDelete
OovStatusReturn FileDelete(OovStringRef const path)
{
return OovStatus(unlink(path.getStr()) == 0 || errno == ENOENT, SC_File);
}
示例14: FileRename
void FileRename(OovStringRef const oldPath, OovStringRef const newPath)
{
rename(oldPath.getStr(), newPath.getStr());
}
示例15: FileDelete
void FileDelete(OovStringRef const path)
{
unlink(path.getStr());
}