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


C++ LString::Length方法代码示例

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


在下文中一共展示了LString::Length方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ExtractPatchInformation

bool CAutoUpdateDialog::ExtractPatchInformation(SgmlElement *pRoot)
{
   m_csPatchUrl = "";
   m_nPatchLevel = 0;
   m_nPatchSizeBytes = 0;

   bool bDeMarkerExists = false;
   bool bIsDeVersion = false;

   CLsUpdt32Dll *pDll = (CLsUpdt32Dll *) AfxGetApp();

   CString csLanguage = pDll->GetLanguage();
   if (csLanguage.Compare(_T("de")) == 0)
   {
      bIsDeVersion = true;

      // check for marker file

      LString lsMarkerFile;
      lsMarkerFile.Allocate(MAX_PATH);
      DWORD dwSize = MAX_PATH;
      bool bRegSuccess = LRegistry::ReadSettingsString(
         _T(""), _T("InstallDir"), (LPTSTR)lsMarkerFile, &dwSize, NULL, true);

      if (bRegSuccess)
      {
         if (lsMarkerFile[lsMarkerFile.Length() - 1] != _T('\\'))
            lsMarkerFile += _T("\\");
         lsMarkerFile += _T("Backend\\marker_de.txt");

         if (_taccess(lsMarkerFile, 00) == 0)
            bDeMarkerExists = true;
      }
   }
      
   CString csOtherPatchUrl = _T("");
   int nOtherPatchSize = 0;

   CArray<SgmlElement *, SgmlElement *> aElements;
   pRoot->GetElements(aElements);
   for (int i = 0; i < aElements.GetSize(); ++i) {
       SgmlElement *pHelp = aElements[i];
       if (pHelp != NULL) {
           if (_tcsicmp(pHelp->GetName(), _T("patchlevel")) == 0) {
               m_nPatchLevel = _ttoi(pHelp->GetParameter());
           } else if (_tcsicmp(pHelp->GetName(), _T("url")) == 0) {
               m_csPatchUrl = pHelp->GetParameter();
           } else if (_tcsicmp(pHelp->GetName(), _T("url-other")) == 0) {
               csOtherPatchUrl = pHelp->GetParameter();
           } else if (_tcsicmp(pHelp->GetName(), _T("size")) == 0) {
               m_nPatchSizeBytes = _ttoi(pHelp->GetParameter());
           } else if (_tcsicmp(pHelp->GetName(), _T("size-other")) == 0) {
               nOtherPatchSize = _ttoi(pHelp->GetParameter());
           }
       }
   }

   // A german version downloads a german patchinfo.xml.
   // This patchinfo.xml links to the (old) German patch file with "url".
   // A new installation (>= 2.0.p3) is always based on the English install package.
   // So for a new installation (!bDeMarkerExists) in the 
   // German case (bIsDeVersion) the other url has to be used for the patch file.
   //
   if (bIsDeVersion && !bDeMarkerExists && csOtherPatchUrl.GetLength() > 0)
   {
      m_csPatchUrl = csOtherPatchUrl;
      m_nPatchSizeBytes = nOtherPatchSize;
   }

   return true;
}
开发者ID:identity0815,项目名称:os45,代码行数:71,代码来源:AutoUpdateDialog.cpp


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