本文整理汇总了C++中OovStringRef::numBytes方法的典型用法代码示例。如果您正苦于以下问题:C++ OovStringRef::numBytes方法的具体用法?C++ OovStringRef::numBytes怎么用?C++ OovStringRef::numBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OovStringRef
的用法示例。
在下文中一共展示了OovStringRef::numBytes方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getSrcRootDirRelativeSrcFileDir
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;
}
示例2: 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;
}
示例3: getMatchingNames
OovStringVec NameValueRecord::getMatchingNames(OovStringRef const baseName) const
{
OovStringVec names;
int len = baseName.numBytes();
for(auto const &nv : mNameValues)
{
if(nv.first.compare(0, len, baseName, len) == 0)
{
names.push_back(nv.first);
}
}
return names;
}
示例4: FilePathGetPosRightPathSep
size_t FilePathGetPosRightPathSep(OovStringRef const path, size_t pos, eReturnPosition rp)
{
if(FilePathIsPathSep(path, pos) && pos < path.numBytes())
pos++;
pos = findPathSep(path, pos);
if(pos == std::string::npos)
{
if(rp == RP_RetPosNatural)
{
pos = FilePathGetPosEndDir(path);
}
}
return pos;
}
示例5: FilePathGetPosEndDir
size_t FilePathGetPosEndDir(OovStringRef const path)
{
size_t pos;
if(FilePathIsEndPathSep(path))
{
pos = path.numBytes() - 1;
}
else
{
pos = rfindPathSep(path);
if(pos == std::string::npos)
pos = FilePathGetPosStartDir(path);
}
return pos;
}
示例6: 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;
}
示例7: 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;
}