本文整理汇总了C++中nsCString::Mid方法的典型用法代码示例。如果您正苦于以下问题:C++ nsCString::Mid方法的具体用法?C++ nsCString::Mid怎么用?C++ nsCString::Mid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsCString
的用法示例。
在下文中一共展示了nsCString::Mid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExtractNoteField
void nsEudoraAddress::ExtractNoteField( nsCString& note, nsCString& value, const char *pFieldName)
{
value.Truncate();
nsCString field("<");
field.Append( pFieldName);
field.Append( ':');
/*
this is a bit of a cheat, but there's no reason it won't work
fine for us, even better than Eudora in some cases!
*/
PRInt32 idx = note.Find( field);
if (idx != -1) {
idx += field.Length();
PRInt32 endIdx = note.FindChar( '>', idx);
if (endIdx == -1)
endIdx = note.Length() - 1;
note.Mid( value, idx, endIdx - idx);
idx -= field.Length();
nsCString tempL;
if (idx)
note.Left( tempL, idx);
nsCString tempR;
note.Right( tempR, note.Length() - endIdx - 1);
note = tempL;
note.Append( tempR);
}
}
示例2: ToLowerCase
nsNullPrincipalURI::nsNullPrincipalURI(const nsCString &aSpec)
{
int32_t dividerPosition = aSpec.FindChar(':');
NS_ASSERTION(dividerPosition != -1, "Malformed URI!");
int32_t n = aSpec.Left(mScheme, dividerPosition);
NS_ASSERTION(n == dividerPosition, "Storing the scheme failed!");
int32_t count = aSpec.Length() - dividerPosition - 1;
n = aSpec.Mid(mPath, dividerPosition + 1, count);
NS_ASSERTION(n == count, "Storing the path failed!");
ToLowerCase(mScheme);
}
示例3: while
void nsEudoraWin32::ConvertPath( nsCString& str)
{
nsCString temp;
nsCString path;
PRInt32 idx = 0;
PRInt32 start = 0;
nsCString search;
idx = str.FindChar( '\\', idx);
if ((idx == 2) && (str.CharAt( 1) == ':'))
{
str.Left( path, 3);
idx++;
idx = str.FindChar( '\\', idx);
start = 3;
if ((idx == -1) && (str.Length() > 3))
{
str.Right( temp, str.Length() - start);
path.Append( temp);
}
}
WIN32_FIND_DATA findFileData;
while (idx != -1)
{
str.Mid( temp, start, idx - start);
search = path;
search.Append( temp);
HANDLE h = FindFirstFile( search.get(), &findFileData);
if (h == INVALID_HANDLE_VALUE)
return;
path.Append( findFileData.cFileName);
idx++;
start = idx;
idx = str.FindChar( '\\', idx);
FindClose( h);
if (idx != -1)
path.Append( '\\');
else
{
str.Right( temp, str.Length() - start);
path.Append( '\\');
path.Append( temp);
}
}
str = path;
}