本文整理汇总了C++中BodyPart::SetShowBodyHeaderFieldsNOT方法的典型用法代码示例。如果您正苦于以下问题:C++ BodyPart::SetShowBodyHeaderFieldsNOT方法的具体用法?C++ BodyPart::SetShowBodyHeaderFieldsNOT怎么用?C++ BodyPart::SetShowBodyHeaderFieldsNOT使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BodyPart
的用法示例。
在下文中一共展示了BodyPart::SetShowBodyHeaderFieldsNOT方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
IMAPFetchParser::BodyPart
IMAPFetchParser::_ParseBODY(const String &sString)
{
BodyPart oPart;
// Set the description.
String sNewName = sString;
sNewName.ReplaceNoCase(_T("BODY.PEEK["), _T("BODY["));
oPart.SetDescription(sNewName);
// Locate the start of the peek-part.
long lBodyStart = sNewName.Find(_T("[")) + 1;
// Locate the end of the part.
long lBodyEnd = sNewName.Find(_T("]"), lBodyStart) - 1;
if (sNewName.Find(_T("<"), lBodyEnd) == lBodyEnd +2)
{
int iStart = lBodyEnd+3;
int iEnd = sNewName.Find(_T(">"), iStart);
String sPartial = sNewName.Mid(iStart, iEnd - iStart);
int iDotPos = sPartial.Find(_T("."));
oPart.m_iOctetStart = _ttoi(sPartial.Mid(0, iDotPos));
oPart.m_iOctetCount = _ttoi(sPartial.Mid(iDotPos+1));
// Remove the octets part from the description.
String sBefore = sNewName.Mid(0, iStart - 1);
String sAfter = sNewName.Mid(iEnd + 1);
String sDescWithoutOctets = sBefore + sAfter;
oPart.SetDescription(sDescWithoutOctets);
}
// Extract the body part.
long lBodyLen = lBodyEnd - lBodyStart +1 ;
String sBody = sNewName.Mid(lBodyStart, lBodyLen);
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;
}
//.........这里部分代码省略.........