当前位置: 首页>>代码示例>>C++>>正文


C++ BodyPart::GetShowBodyText方法代码示例

本文整理汇总了C++中BodyPart::GetShowBodyText方法的典型用法代码示例。如果您正苦于以下问题:C++ BodyPart::GetShowBodyText方法的具体用法?C++ BodyPart::GetShowBodyText怎么用?C++ BodyPart::GetShowBodyText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BodyPart的用法示例。


在下文中一共展示了BodyPart::GetShowBodyText方法的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;

   }
开发者ID:Bill48105,项目名称:hmailserver,代码行数:101,代码来源:IMAPFetchParser.cpp


注:本文中的BodyPart::GetShowBodyText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。