当前位置: 首页 > news >正文

主机托管网站北京seo服务商找行者seo

主机托管网站,北京seo服务商找行者seo,优秀的网站首页布局,合肥专业制作网站NTFS 文件搜索库 中文 | English 一个快速搜索NTFS卷文件的库 在这里插入图片描述 特性 快速扫描 NTFS 格式驱动器上的所有文件实时快速同步文件变更(创建, 更名, 删除)支持通配符查询文件名或文件路径重启自动更新文件变动, 无需重新进行全盘扫描 API描述 初始化并指定…

NTFS 文件搜索库

中文 | English

一个快速搜索NTFS卷文件的库

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

特性

  • 快速扫描 NTFS 格式驱动器上的所有文件
  • 实时快速同步文件变更(创建, 更名, 删除)
  • 支持通配符查询文件名或文件路径
  • 重启自动更新文件变动, 无需重新进行全盘扫描

API描述

  • 初始化并指定你关注的驱动器

    //
    // @brief: 初始化(驱动器掩码)
    // @param: dwDriveIndexMask     驱动器索引掩码(位组合: C: 0x01 D: 0x02 E: 0x04...)
    // @param: strDbPath            数据库文件路径
    // @param: fRebuildDb           是否重建数据库
    // @ret:   BOOL                 操作是否成功
    BOOL NTFS_Search_Initialize_By_Drive_Mask(DWORD dwDriveIndexMask, LPCTSTR lpDbPath,bool fRebuildDb
    );//
    // @brief: 初始化(驱动器盘符)
    // @param: strDriveList         驱动器列表, 如: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    // @param: strDbPath            数据库文件路径
    // @param: fRebuildDb           是否重建数据库
    // @ret:   BOOL                 操作是否成功
    BOOL NTFS_Search_Initialize_By_Drive_Letter(LPCTSTR lpDriveList,LPCTSTR lpDbPath,bool fRebuildDb
    );
    
  • 重置并指定你关注的驱动器

    
    //
    // @brief: 重置(驱动器掩码)
    // @param: dwDriveIndexMask     驱动器索引掩码(位组合: C: 0x01 D: 0x02 E: 0x04...)
    // @param: strDbPath            数据库文件路径
    // @param: fRebuildDb           是否重建数据库
    // @ret:   BOOL                 操作是否成功
    NTFSSEARCH_API BOOL NTFS_Search_Reset_By_Drive_Mask(DWORD dwDriveIndexMask,LPCTSTR lpDbPath,bool fRebuildDb
    );//
    // @brief: 重置(驱动器盘符)
    // @param: strDriveList         驱动器列表, 如: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    // @param: strDbPath            数据库文件路径
    // @param: fRebuildDb           是否重建数据库
    // @ret:   BOOL                 操作是否成功
    NTFSSEARCH_API BOOL NTFS_Search_Reset_By_Drive_Letter(LPCTSTR lpDriveList,LPCTSTR lpDbPath,bool fRebuildDb
    );
    
  • 获取当前文件总数

    //
    // @brief: 获取当前文件总数
    // @ret:   LONGLONG               当前文件总数
    NTFSSEARCH_API LONGLONG NTFS_Search_GetCount();
    
  • 查询文件, 支持通配符(* 匹配 0 个或多个字符 ? 匹配 1 个字符)

    //
    // @brief: 查询文件路径
    // @param: lpKeyword            关键字, 如: "C:\*.zip"
    // @param: cb                   查询回调函数(返回FALSE终止结果枚举)
    // @param: lpData               回调函数附加参数
    // @ret:   BOOL                 操作是否成功
    NTFSSEARCH_API BOOL NTFS_Search_Query(LPCTSTR lpKeyword,NtfsSearchCallback cb,LPVOID lpData
    );
    
  • 反初始化

    //
    // @brief: 反初始化
    // @ret:   void                 操作是否成功
    NTFSSEARCH_API VOID NTFS_Search_Uninitialize();
    

性能描述

  • 拥有较好的性能

    • 全盘扫描 77 万文件耗时约 13秒
    • 搜索 * 耗时 1.3秒
    • 搜索 *.zip 耗时 0.2秒
  • 内存占用小

    • 77 万 文件数内存占用仅 100MB 左右
  • 数据库文件占用

    • 77 万 文件数据库存储占用 300+ MB 磁盘空间

使用例子

#include <windows.h>
#include <tchar.h>
#include <locale>
#include <string>
#include <vector>
#include "../NTFS_Search_Lib/include/NTFS_Search_Api.h"#ifdef _UNICODE
using _tstring = std::wstring;
#else
using _tstring = std::string;
#endif#ifndef _DEBUG#ifdef _UNICODE#ifdef _WIN64
#pragma comment(lib, "../NTFS_Search_lib/lib/NTFS_Search_Lib_x64_W.lib")
#else
#pragma comment(lib, "../NTFS_Search_lib/lib/NTFS_Search_Lib_x86_W.lib")
#endif#else#ifdef _WIN64
#pragma comment(lib, "../NTFS_Search_lib/lib/NTFS_Search_Lib_x64_A.lib")
#else
#pragma comment(lib, "../NTFS_Search_lib/lib/NTFS_Search_Lib_x86_A.lib")
#endif#endif#else
#ifdef _UNICODE#ifdef _WIN64
#pragma comment(lib, "../NTFS_Search_lib/lib/NTFS_Search_Lib_x64_WD.lib")
#else
#pragma comment(lib, "../NTFS_Search_lib/lib/NTFS_Search_Lib_x86_WD.lib")
#endif#else#ifdef _WIN64
#pragma comment(lib, "../NTFS_Search_lib/lib/NTFS_Search_Lib_x64_AD.lib")
#else
#pragma comment(lib, "../NTFS_Search_lib/lib/NTFS_Search_Lib_x86_AD.lib")
#endif#endif#endifstd::wstring _MultiStrToWStr(UINT CodePage, const std::string& str)
{int cchWideChar = ::MultiByteToWideChar(CodePage, 0, str.c_str(), -1, NULL, 0);std::wstring strResult(cchWideChar, 0);size_t nConverted = ::MultiByteToWideChar(CodePage, 0, str.c_str(), (int)str.size(), &strResult[0], (int)strResult.size());strResult.resize(nConverted);return strResult;
}_tstring AStrToTStr(const std::string& str)
{
#ifdef _UNICODEreturn _MultiStrToWStr(CP_ACP, str);
#elsereturn str;
#endif
}int _tmain(int argc, LPCTSTR argv[])
{setlocale(LC_ALL, "");clock_t tmBegin = ::clock();clock_t tmEnd = ::clock();_tstring strDriveList = _T("");_tstring strDbPath = _T("");// 初始化NTFS_Search_Initialize_By_Drive_Letter(strDriveList.c_str(), strDbPath.c_str(), false);if (0 == NTFS_Search_GetCount()){_tprintf(_T("扫描指定驱动器: %s\n"), strDriveList.c_str());tmBegin = ::clock();NTFS_Search_Reset_By_Drive_Letter(strDriveList.c_str(), strDbPath.c_str(), true);tmEnd = ::clock();_tprintf(_T("扫描耗时: %d毫秒\n"), tmEnd - tmBegin);}_tstring strKey;while (true){char szBuf[MAX_PATH] = { 0 };_tprintf(_T("文件数: %llu\n"), NTFS_Search_GetCount());_tprintf(_T("命令: \n"));_tprintf(_T("    :r  重新扫描, 如: :r\n"));_tprintf(_T("    ::  重新扫描指定驱动器, 如: ::CDEF\n"));_tprintf(_T("    :q  退出, 如: :q\n"));_tprintf(_T("查找关键字: "));strKey.clear();while (strKey.empty()){gets_s(szBuf, sizeof(szBuf));strKey = AStrToTStr(szBuf);}if (0 == _strnicmp(szBuf, "::", 2)){strDriveList = strKey.substr(2);_tprintf(_T("重新扫描指定驱动器: %s\n"), strDriveList.c_str());tmBegin = ::clock();NTFS_Search_Reset_By_Drive_Letter(strDriveList.c_str(), strDbPath.c_str(), true);tmEnd = ::clock();_tprintf(_T("总共耗时: %d毫秒\n"), tmEnd - tmBegin);continue;}if (0 == _stricmp(szBuf, ":r")){_tprintf(_T("重新扫描\n"));tmBegin = ::clock();NTFS_Search_Reset_By_Drive_Letter(strDriveList.c_str(), strDbPath.c_str(), true);tmEnd = ::clock();_tprintf(_T("总共耗时: %d毫秒\n"), tmEnd - tmBegin);continue;}if (0 == _stricmp(szBuf, ":q")){_tprintf(_T("退出\n"));break;}_tprintf(_T(R"(查询中...)"));_tprintf(_T("\n"));std::vector<_tstring> fileList;tmBegin = ::clock();int nRes = NTFS_Search_Query(strKey.c_str(), [](LPVOID lpData, LPCTSTR lpPath) -> bool {std::vector<_tstring>* pList = (std::vector<_tstring>*)lpData;pList->push_back(lpPath);return true;},&fileList);tmEnd = ::clock();int nIndex = 0;for (const auto& item : fileList){_tprintf(_T("%d: %s\r\n"), ++nIndex, item.c_str());if (nIndex >= 100){break;}}_tprintf(_T("\n"));_tprintf(_T("耗时: %g秒 查找结果: %d \n"), (double)((tmEnd - tmBegin)) / 1000.0f, (int)fileList.size());}NTFS_Search_Uninitialize();return 0;
};

动态库 & 静态库

https://gitee.com/flame_cyclone/ntfs_search
http://www.wangmingla.cn/news/134634.html

相关文章:

  • 白云免费网站建设seo优化推广教程
  • 珠海澳门网站建设公司哪家好重庆seo网站推广费用
  • 做推广软件seo页面如何优化
  • 企业手机网站建设精英怎么样推广自己的产品
  • j集团公司的网站建设国际重大新闻
  • 建立网站费用多少网络营销推广公司名称
  • 重庆巴南区网站建设网络推广员好做吗
  • 怎么才能打开一些网站免费seo工具大全
  • 网站建设 电子商务 品牌首选IDC互联网营销培训课程
  • 怎么用ssm做网站开发一个小程序一般需要多少钱呢
  • 做静态网站d网络营销方式有哪些?
  • 深圳网站建设民治大道廊坊快速排名优化
  • 金融系统网站模板短视频seo营销系统
  • 模板网站 seo2023b站推广大全
  • 做it的网站新河seo怎么做整站排名
  • 区块链技术做网站网站推广引流
  • 招标网上的项目好中标吗昆明seo关键词
  • 网站制作.收录查询站长工具
  • 2019怎么做网站赚钱软文推广怎么做
  • 怎么查看什么公司做的网站吗中国百强城市榜单
  • 做网站建设需要多少钱做网络推广怎么找客户
  • 医程通 网站做的太科技公司网站制作公司
  • wordpress很多英文文章厦门seo优化推广
  • 郑州做网站优化公齐三seo顾问
  • wordpress设置谷歌验证系统优化工具
  • 建程网土石方工程seo关键词排名优化哪家好
  • 安卓做视频网站好离我最近的广告公司
  • 如果自己弄网站seo关键词排名优化系统
  • 做返利网站网站优化培训
  • 帮别人备案网站吗卡一卡二卡三入口2021