本文整理汇总了C++中BodyPart::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ BodyPart::SetName方法的具体用法?C++ BodyPart::SetName怎么用?C++ BodyPart::SetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BodyPart
的用法示例。
在下文中一共展示了BodyPart::SetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//.........这里部分代码省略.........
if (sBody.IsEmpty())
{
oPart.SetShowBodyFull(true);
m_bSetSeen = true;
}
else
{
// Determine what to look at.
long lTemp = 0;
// Should we show all header fields except for...
lTemp = sBody.FindNoCase(_T("HEADER.FIELDS.NOT"));
if (lTemp >= 0)
{
int lStart = sBody.Find(_T("("), lTemp) + 1;
int lEnd = sBody.Find(_T(")"), lStart) ;
int lLength = lEnd - lStart;
String sFields = sBody.Mid(lStart, lLength);
oPart.GetHeaderFieldsNOT() = StringParser::SplitString(sFields, " ");
oPart.SetShowBodyHeaderFieldsNOT(true);
// Strip away the header fields part from the Body.
// If we don't do this, we will parse the same string
// as header.fields below.
String sBefore = sBody.Mid(0, lTemp);
String sAfter = sBody.Mid(lEnd + 2);
sBody = sBefore + sAfter;
}
// Should we show header fields?
lTemp = sBody.FindNoCase(_T("HEADER.FIELDS"));
if (lTemp >= 0)
{
int lStart = sBody.Find(_T("("), lTemp) + 1;
int lEnd = sBody.Find(_T(")"), lStart) ;
int lLength = lEnd - lStart;
String sFields = sBody.Mid(lStart, lLength);
oPart.GetHeaderFields() = StringParser::SplitString(sFields, " ");
oPart.SetShowBodyHeaderFields(true);
// Strip away the header fields part from the Body.
String sBefore = sBody.Mid(0, lTemp);
String sAfter = sBody.Mid(lEnd + 2);
sBody = sBefore + sAfter;
}
lTemp = sBody.FindNoCase(_T("HEADER"));
if (lTemp >= 0)
{
oPart.SetShowBodyHeader(true);
String sBefore = sBody.Mid(0, lTemp);
String sAfter = sBody.Mid(lTemp + 7);
sBody = sBefore + sAfter;
}
lTemp = sBody.FindNoCase(_T("MIME"));
if (lTemp >= 0)
{
oPart.SetShowBodyHeader(true);
String sBefore = sBody.Mid(0, lTemp);
String sAfter = sBody.Mid(lTemp + 7);
sBody = sBefore + sAfter;
}
lTemp = sBody.FindNoCase(_T("TEXT"));
if (lTemp >= 0)
{
oPart.SetShowBodyText(true);
String sBefore = sBody.Mid(0, lTemp);
String sAfter = sBody.Mid(lTemp + 5);
sBody = sBefore + sAfter;
m_bSetSeen = true;
}
if (!oPart.GetShowBodyText() &&
!oPart.GetShowBodyHeader() &&
!oPart.GetShowBodyHeaderFields() &&
!oPart.GetShowBodyHeaderFieldsNOT())
{
oPart.SetShowBodyText(true);
m_bSetSeen = true;
}
sBody = sBody.TrimLeft(_T("."));
sBody = sBody.TrimRight(_T("."));
oPart.SetName(sBody);
}
return oPart;
}