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


C++ FileNode::GetSendSize方法代码示例

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


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

示例1: searchAllFile


//.........这里部分代码省略.........
        if ((STRCMP(find_file_data.cFileName, _STR("..")) == 0) ||
          (STRCMP(find_file_data.cFileName, _STR(".")) == 0))
          continue;

        if (find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { continue; }

        /*
        long result = CompareFileTime(&find_file_data.ftCreationTime,  // NOLINT
          &comparison_filetime);
        // File was created after or on comparison time
        if ((result == 1) || (result == 0))
          ++file_count;
        */

        // is we need file
        //uint32_t nMatchLen = STRLEN(find_file_data.cFileName);
        if (TRUE == pCollectRule->regExExclude.didCompile()
          && TRUE == pCollectRule->regExExclude.isMatchOnly(find_file_data.cFileName)
        ) { continue; }

        if (FALSE == pCollectRule->regExInclude.isMatchOnly(find_file_data.cFileName)) { continue; }

        // test file
//         char_t strPath[MAX_PATH + 1] = {0};
//         SNPRINTF(strPath, MAX_PATH, MAX_PATH, "%s/%s", pCollectRule->dir, find_file_data.cFileName);
//         AutoReleaseFile autoRelFile(OpenFile(strPath, strAttrOpenRead));
//         if (NULL == autoRelFile) { continue; }

        // find map
        FileNode* pFileNode;
        if (MEM_NINI_LOG == collector_log_type) {
          pFileNode = findFileNode(pCollectRule->mml_hash, find_file_data.cFileName);
        }
        else {
          pFileNode = findFileNode(pCollectRule->hash, find_file_data.cFileName);
        }
        if (NULL == pFileNode) {

          if (TRUE == m_bAfterToDay) {
          // time control
          SYSTEMTIME nCreateTime;
          SYSTEMTIME stUTC;
          if (FALSE == FileTimeToSystemTime(&(find_file_data.ftCreationTime), &stUTC)
            || FALSE == SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &nCreateTime)
            ) { continue; }

          if (nCreateTime.wYear != today.tm_year + 1900
            || nCreateTime.wMonth != today.tm_mon + 1
            || nCreateTime.wDay != today.tm_mday
            ) { continue; }
          }


//           char_t strPath[MAX_PATH + 1] = {0};
//           SNPRINTF(strPath, MAX_PATH, MAX_PATH, "%s/%s", pCollectRule->dir, find_file_data.cFileName);

//           AutoReleaseFile AutoRelFile(::OpenFile(strPath, strAttrOpenRead));
//           if (NULL == AutoRelFile) { continue; }
// 
          pFileNode = new FileNode(pCollectRule->dir
            , MEM_NINI_LOG == collector_log_type ? pCollectRule->GetMMLDir() : NULL
            , find_file_data.cFileName);
          if (NULL == pFileNode) { continue; }

          // update file info
          FindData2FileInfo(&pFileNode->FileInfo(), find_file_data);

          // add to map
          addFileNode(pCollectRule->hash, pFileNode->LocalName(), pFileNode);

          // new file
          if (RC_S_OK != (pfn_cb)(/*this, */pFileNode, context)) { break; }
        }
        else {

          ASSERT(pFileNode);

          // update file info
          PlatformFileInfo& fileInfo = pFileNode->FileInfo();
          FindData2FileInfo(&fileInfo, find_file_data);

          if (pFileNode->GetSendSize() < fileInfo.size) {

            // new data
            if (RC_S_OK != (pfn_cb)(/*this, */pFileNode, context)) { break; }
          }
        }

      } while (FindNextFile(find_handle,  &find_file_data));

      FindClose(find_handle);
    }
  }
//    __except(EXCEPTION_EXECUTE_HANDLER) {
// 
//     return TRUE;
//   }

  return TRUE;
}
开发者ID:obabywawa,项目名称:logsystem,代码行数:101,代码来源:file_collector_impl.cpp


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