本文整理汇总了C++中nsString::RFindChar方法的典型用法代码示例。如果您正苦于以下问题:C++ nsString::RFindChar方法的具体用法?C++ nsString::RFindChar怎么用?C++ nsString::RFindChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsString
的用法示例。
在下文中一共展示了nsString::RFindChar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CleanupHandlerPath
// Strip a handler command string of its quotes and parameters.
static void CleanupHandlerPath(nsString& aPath)
{
// Example command strings passed into this routine:
// 1) C:\Program Files\Company\some.exe -foo -bar
// 2) C:\Program Files\Company\some.dll
// 3) C:\Windows\some.dll,-foo -bar
// 4) C:\Windows\some.cpl,-foo -bar
int32_t lastCommaPos = aPath.RFindChar(',');
if (lastCommaPos != kNotFound)
aPath.Truncate(lastCommaPos);
aPath.Append(' ');
// case insensitive
uint32_t index = aPath.Find(".exe ", true);
if (index == kNotFound)
index = aPath.Find(".dll ", true);
if (index == kNotFound)
index = aPath.Find(".cpl ", true);
if (index != kNotFound)
aPath.Truncate(index + 4);
aPath.Trim(" ", true, true);
}
示例2: SplitString
void nsOutlookMail::SplitString(nsString& val1, nsString& val2)
{
// Find the last line if there is more than one!
int32_t idx = val1.RFind("\x0D\x0A");
int32_t cnt = 2;
if (idx == -1) {
cnt = 1;
idx = val1.RFindChar(13);
}
if (idx == -1)
idx= val1.RFindChar(10);
if (idx != -1) {
val2 = Substring(val1, idx + cnt);
val1.SetLength(idx);
SanitizeValue(val1);
}
}
示例3: SplitString
void nsOutlookMail::SplitString( nsString& val1, nsString& val2)
{
nsString temp;
// Find the last line if there is more than one!
PRInt32 idx = val1.RFind( "\x0D\x0A");
PRInt32 cnt = 2;
if (idx == -1) {
cnt = 1;
idx = val1.RFindChar( 13);
}
if (idx == -1)
idx= val1.RFindChar( 10);
if (idx != -1) {
val1.Right( val2, val1.Length() - idx - cnt);
val1.Left( temp, idx);
val1 = temp;
SanitizeValue( val1);
}
}