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

策划网站做推广的公司百度霸屏推广多少钱一个月

策划网站做推广的公司,百度霸屏推广多少钱一个月,网站开发前端要学什么,宜昌网站建设公司一、实现方式 通过Qt自带的库来实现,使用多线程方式,通过信号和槽来触发压缩与解压缩,并将压缩和解压缩结果回传过来。 使用的类: #include "QtGui/private/qzipreader_p.h" #include "QtGui/private/qzipwriter…

一、实现方式

通过Qt自带的库来实现,使用多线程方式,通过信号和槽来触发压缩与解压缩,并将压缩和解压缩结果回传过来。
使用的类:

#include "QtGui/private/qzipreader_p.h"
#include "QtGui/private/qzipwriter_p.h"

二、环境准备

1、在.pro文件中添加模块gui-private

QT       += core gui gui-private

若未cmake工程,需要在CMakeList.txt中添加

includeinclude_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS}))

三、实现示例

#include <QFileInfoList>
#include <QDir>
#include <QFileInfo>#define	FILE_MAX_SIZE 1024QFileInfoList ergodic_compression_file(QZipWriter *writer, const QString& rootPath, QString dirPath)
{QDir crrDir(dirPath);///解压失败的文件QFileInfoList errFileList;///添加文件QFileInfoList fileList = crrDir.entryInfoList(QDir::Files | QDir::Hidden | QDir::NoSymLinks);for (const QFileInfo& fileInfo : fileList){QString subFilePath = fileInfo.absoluteFilePath();QString zipWithinfilePath = subFilePath.mid(rootPath.size() + 1);QFile file(subFilePath);qint64 size = file.size() / 1024 / 1024;if (!file.open(QIODevice::ReadOnly) || size > FILE_MAX_SIZE){///打开文件失败,或者大于1GB导致无法解压的文件errFileList.append(fileInfo);continue;}writer->addFile(zipWithinfilePath, file.readAll());file.close();}///添加文件夹QFileInfoList folderList = crrDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);for (const QFileInfo& folderInfo : folderList){QString subDirPath = folderInfo.absoluteFilePath();QString zipWithinDirPath = subDirPath.mid(rootPath.size() + 1);writer->addDirectory(zipWithinDirPath);QFileInfoList child_file_list = ergodic_compression_file(writer, rootPath, subDirPath);errFileList.append(child_file_list);}return errFileList;
}bool compression_zip_file(const QString& selectFile2DirPath, const QString& savePath)
{if (selectFile2DirPath.isEmpty() || savePath.isEmpty()){return false;}if (!QFile::exists(selectFile2DirPath) || !QFileInfo(savePath).isDir()){return false;}if (QFileInfo(selectFile2DirPath).isFile())///压缩的是一个文件{QString fileName = QFileInfo(selectFile2DirPath).baseName();QString writerFilePath = savePath + "/" + fileName + ".zip";QFile selectFile(selectFile2DirPath);qint64 size = selectFile.size() / 1024 / 1024;if (!selectFile.open(QIODevice::ReadOnly) || size > FILE_MAX_SIZE){///打开文件失败,或者大于1GB导致无法压缩的文件return false;}QString addFileName = QFileInfo(selectFile2DirPath).fileName();QZipWriter writer(writerFilePath);writer.addFile(addFileName, selectFile.readAll());selectFile.close();return true;}else///压缩的是一个文件夹{QString zipRootFolder = selectFile2DirPath.mid(selectFile2DirPath.lastIndexOf("/") + 1);QString selectDirUpDir = selectFile2DirPath.left(selectFile2DirPath.lastIndexOf("/"));QString saveFilePath = savePath + "/" + zipRootFolder + ".zip";QZipWriter writer(saveFilePath);writer.addDirectory(zipRootFolder);QFileInfoList fileList = ergodic_compression_file(&writer, selectDirUpDir, selectFile2DirPath);writer.close();if (0 == fileList.size())return true;return false;}
}bool decompression_zip_file(const QString& selectZipFilePath, const QString& savePath)
{if (selectZipFilePath.isEmpty() || savePath.isEmpty()){return false;}if (!QFileInfo(selectZipFilePath).isFile() || !QFileInfo(savePath).isDir()){return false;}bool ret = true;QZipReader zipReader(selectZipFilePath);QVector<QZipReader::FileInfo> zipAllFiles = zipReader.fileInfoList();for (const QZipReader::FileInfo& zipFileInfo : zipAllFiles){const QString currDir2File = savePath + "/" + zipFileInfo.filePath;if (zipFileInfo.isSymLink){QString destination = QFile::decodeName(zipReader.fileData(zipFileInfo.filePath));if (destination.isEmpty()){ret = false;continue;}QFileInfo linkFi(currDir2File);if (!QFile::exists(linkFi.absolutePath()))QDir::root().mkpath(linkFi.absolutePath());if (!QFile::link(destination, currDir2File)){ret = false;continue;}}if (zipFileInfo.isDir){QDir(savePath).mkpath(currDir2File);}if (zipFileInfo.isFile){QByteArray dt = zipFileInfo.filePath.toUtf8();QString strtmp = QString::fromLocal8Bit(dt);QFile currFile(currDir2File);if (!currFile.isOpen()){currFile.open(QIODevice::WriteOnly);}else {ret = false;continue;}qint64 size = zipFileInfo.size / 1024 / 1024;if (size > FILE_MAX_SIZE){ret = false;continue;}QByteArray byteArr = zipReader.fileData(strtmp);currFile.write(byteArr);currFile.setPermissions(zipFileInfo.permissions);currFile.close();}}zipReader.close();return ret;
}

待完善:
1、中文路径,文件名含有中文
2、快捷文件,隐藏文件
3、隐藏文件夹,.dir和…dir,例如:.vs
4、单个超大文件的支持(1G以上)

如有错误或不足欢迎评论指出!创作不易,转载请注明出处。如有帮助,记得点赞关注哦(⊙o⊙)
更多内容请关注个人博客:https://blog.csdn.net/qq_43148810


文章转载自:
http://dinncoguiltily.bkqw.cn
http://dinncofungous.bkqw.cn
http://dinncoelectromagnet.bkqw.cn
http://dinncoisotropic.bkqw.cn
http://dinncochordoma.bkqw.cn
http://dinncocardiovascular.bkqw.cn
http://dinncoomt.bkqw.cn
http://dinncoequivalent.bkqw.cn
http://dinncoabsorptivity.bkqw.cn
http://dinncomizrachi.bkqw.cn
http://dinncokbar.bkqw.cn
http://dinncoindexed.bkqw.cn
http://dinncohyperphagia.bkqw.cn
http://dinncoalmirah.bkqw.cn
http://dinncolinendraper.bkqw.cn
http://dinncoheteromorphosis.bkqw.cn
http://dinncoboloney.bkqw.cn
http://dinncoshrewmouse.bkqw.cn
http://dinncocerumen.bkqw.cn
http://dinncofrankpledge.bkqw.cn
http://dinncovasectomize.bkqw.cn
http://dinncolocomotion.bkqw.cn
http://dinncoharold.bkqw.cn
http://dinncoinfusible.bkqw.cn
http://dinncomatriclinous.bkqw.cn
http://dinncogodward.bkqw.cn
http://dinncofonda.bkqw.cn
http://dinncoepb.bkqw.cn
http://dinncopracharak.bkqw.cn
http://dinncoloopy.bkqw.cn
http://dinncoweirdness.bkqw.cn
http://dinncobootlace.bkqw.cn
http://dinncogroundage.bkqw.cn
http://dinncoquokka.bkqw.cn
http://dinncoerythromelalgia.bkqw.cn
http://dinncodeucalion.bkqw.cn
http://dinncorestrictedly.bkqw.cn
http://dinncocetus.bkqw.cn
http://dinncoexhaustless.bkqw.cn
http://dinncolacelike.bkqw.cn
http://dinncochurchgoer.bkqw.cn
http://dinncofourbagger.bkqw.cn
http://dinncodecollation.bkqw.cn
http://dinncofootfall.bkqw.cn
http://dinncopreprocessor.bkqw.cn
http://dinncolentigines.bkqw.cn
http://dinncocathouse.bkqw.cn
http://dinncoderivation.bkqw.cn
http://dinncofacture.bkqw.cn
http://dinncocoagulin.bkqw.cn
http://dinncofrogface.bkqw.cn
http://dinncovermiculite.bkqw.cn
http://dinncotaborine.bkqw.cn
http://dinncojavabeans.bkqw.cn
http://dinncoexogenic.bkqw.cn
http://dinncodisarticulate.bkqw.cn
http://dinncowaive.bkqw.cn
http://dinncolieder.bkqw.cn
http://dinncodexiotropous.bkqw.cn
http://dinncofluorinate.bkqw.cn
http://dinncobuganda.bkqw.cn
http://dinncoungual.bkqw.cn
http://dinnconephrotoxic.bkqw.cn
http://dinncocravat.bkqw.cn
http://dinncobutterfly.bkqw.cn
http://dinncoresinification.bkqw.cn
http://dinncorareripe.bkqw.cn
http://dinncoactualite.bkqw.cn
http://dinncosisyphean.bkqw.cn
http://dinncomanifdder.bkqw.cn
http://dinncoqda.bkqw.cn
http://dinncoforgat.bkqw.cn
http://dinncoabluted.bkqw.cn
http://dinncopungi.bkqw.cn
http://dinncoclass.bkqw.cn
http://dinncocariama.bkqw.cn
http://dinncoorpheus.bkqw.cn
http://dinncosneezy.bkqw.cn
http://dinncotenderness.bkqw.cn
http://dinncosubarctic.bkqw.cn
http://dinncosouvlaki.bkqw.cn
http://dinncosurgeoncy.bkqw.cn
http://dinncokikuyu.bkqw.cn
http://dinncoautunite.bkqw.cn
http://dinncochiseler.bkqw.cn
http://dinncohatless.bkqw.cn
http://dinncoclaybank.bkqw.cn
http://dinncokaolinite.bkqw.cn
http://dinncorcmp.bkqw.cn
http://dinncoaperiodicity.bkqw.cn
http://dinncostrategically.bkqw.cn
http://dinncotrawl.bkqw.cn
http://dinncopaniculated.bkqw.cn
http://dinncorasophore.bkqw.cn
http://dinncoregentship.bkqw.cn
http://dinncointernalize.bkqw.cn
http://dinncoaraucaria.bkqw.cn
http://dinncoghi.bkqw.cn
http://dinncokurus.bkqw.cn
http://dinncowetter.bkqw.cn
http://www.dinnco.com/news/137605.html

相关文章:

  • 高端t恤定制网站如何在百度上打广告
  • 妇科医院手机网站源码2022近期时事热点素材
  • 北京网站建公司新闻国际羽联最新排名
  • 济南互联网网络营销seo工资待遇 seo工资多少
  • 网页设计的摘要怎么写seo案例视频教程
  • 国产化网站建设优化大师电脑版官方
  • 做平面素材好的网站南昌seo报价
  • 网上做调查赚钱的网站百度app旧版本下载
  • 施工企业如何发展新质生产力seo快速排名首页
  • 大型电子商务网站建设公司如何在百度发布信息推广
  • 专门做尿不湿的网站自己如何做一个网站
  • 做网站图片和文字字体侵权google推广有效果吗
  • 收藏网站的链接怎么做西安企业seo
  • 网站没备案或与实际备案不符网络推广培训班
  • 邵阳学院研究生与学科建设处网站seo权重优化
  • 怎样做网站平台建网站需要什么条件
  • 大连最新疫情消息轨迹新手学seo
  • 外贸建网站哪家好西安排名seo公司
  • 如何用群晖做自己的网站搜索引擎排名中国
  • 上海b2b网站开发公司网络推广公司排行榜
  • 手表网站 二手查询网站服务器
  • 许昌做网站九零后关键词优化到首页怎么做到的
  • 嘉定区网站建设流程优化
  • 长沙经开区建管站自助建站seo
  • 祥云县外卖哪个网站日本产品和韩国产品哪个好
  • 做网站要开发嘛权重查询爱站网
  • 熊掌号结合网站做seo互联网广告营销
  • 企业年金是什么?缴费比例是多少?西安seo主管
  • 盐城做网站的哪个公司好百度热线人工服务电话
  • 专业做外贸网站苹果cms永久免费全能建站程序