本文整理汇总了C++中OovString::rfind方法的典型用法代码示例。如果您正苦于以下问题:C++ OovString::rfind方法的具体用法?C++ OovString::rfind怎么用?C++ OovString::rfind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OovString
的用法示例。
在下文中一共展示了OovString::rfind方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rfindPathSep
// returns std::string::npos if not found.
static size_t rfindPathSep(OovStringRef const path, size_t startPos = std::string::npos)
{
const OovString str = path;
size_t bpos = str.rfind('\\', startPos);
size_t fpos = str.rfind('/', startPos);
size_t pos = std::string::npos;
if(bpos != std::string::npos && fpos != std::string::npos)
{
pos = (bpos > fpos) ? bpos : fpos;
}
else if(bpos != std::string::npos)
pos = bpos;
else if(fpos != std::string::npos)
pos = fpos;
return pos;
}
示例2: getComponentParentName
std::string ComponentTypesFile::getComponentParentName(std::string const &compName)
{
OovString parent = compName;
size_t pos = parent.rfind('/');
if(pos != OovString::npos)
{
parent.erase(pos);
}
return parent;
}
示例3: getComponentChildName
std::string ComponentTypesFile::getComponentChildName(std::string const &compName)
{
OovString child = compName;
size_t pos = child.rfind('/');
if(pos != OovString::npos)
{
child.erase(0, pos+1);
}
return child;
}
示例4: makeOrigCovFn
/// Use the filename to make an identifier.
static std::string makeOrigCovFn(OovStringRef const fn)
{
OovString covFn = fn;
if(covFn.find("COV_") != std::string::npos)
{
covFn.erase(0, 4);
}
covFn.replaceStrs("_", "/");
size_t pos = covFn.rfind('/');
if(pos != std::string::npos)
{
covFn.replace(pos, 1, ".");
}
return covFn;
}
示例5: appendNames
void CMaker::appendNames(OovStringVec const &names,
char delim, OovString &str)
{
for(auto const &name : names)
{
str += name;
str += delim;
size_t startpos = str.rfind('\n');
if(startpos == std::string::npos)
startpos = 0;
if(str.length() - startpos > 70)
{
str += "\n ";
}
}
int len = str.length();
if(len > 0 && str[len-1] == delim)
str.resize(len-1);
}
示例6:
extern "C" G_MODULE_EXPORT gboolean on_StackTextview_button_press_event(GtkWidget *widget,
GdkEvent *event, gpointer user_data)
{
GdkEventButton *buttEvent = reinterpret_cast<GdkEventButton *>(event);
if(buttEvent->type == GDK_2BUTTON_PRESS)
{
GtkTextView *widget = GTK_TEXT_VIEW(ControlWindow::getTabView(
ControlWindow::CT_Stack));
OovString line = Gui::getCurrentLineText(GTK_TEXT_VIEW(widget));
gEditor->debugSetStackFrame(line);
size_t pos = line.rfind(' ');
if(pos != std::string::npos)
{
pos++;
line.erase(0, pos);
}
gEditor->gotoFileLine(line);
}
return false;
}
示例7: coerceParentComponents
void ComponentTypesFile::coerceParentComponents(OovStringRef const compName)
{
OovString name = compName;
while(1)
{
size_t pos = name.rfind('/');
if(pos != std::string::npos)
{
name.erase(pos);
}
if(compName != name.getStr())
{
setComponentType(name, CT_Unknown);
}
if(pos == std::string::npos)
{
break;
}
}
}