草庐IT

zip_entry

全部标签

android - 将 Zip 提取到 SD 卡非常慢。我如何优化性能?

我的应用下载了一个包含大约350个文件的zip。JPG和HTML文件的混合。我为它编写的函数工作得很好,但解压缩需要永远。起初我认为原因可能是写入sd卡很慢。但是当我用手机上的其他应用程序解压缩相同的zip时,它的运行速度要快得多。我可以做些什么来优化它吗?代码如下:privatevoidextract(){try{FileInputStreaminStream=newFileInputStream(targetFilePath);ZipInputStreamzipStream=newZipInputStream(newBufferedInputStream(inStream));Zi

c++ - 在 boost 元组、zip_iterator 等上使用 std::get 和 std::tie

使用std::get()有哪些选择?和std::tie()与boost结构一起?例子:我想使用基于范围的for循环对多个容器进行迭代。我可以实现zip函数,它使用boost::zip_iterator.#include#includetemplateautozip(TContainer&...containers)->boost::iterator_range>{autozip_begin=boost::make_zip_iterator(boost::make_tuple(std::begin(containers)...));autozip_end=boost::make_zip_

c++ - unique_ptr : linked list entry deletion

我目前正在考虑借助unique_ptr实现单链表。尽管由于析构函数的递归调用(请参阅Stackoverflowwithunique_ptrlinkedlist)可能会出现堆栈溢出的问题,但我还是遇到了以下问题:假设,我们有以下链表的实现structnode{node(void):val(0),next(nullptr){}intval;std::unique_ptrnext;};并且我们已经根据初始化了我们的列表intmain(intargc,char*argv[]){nodeHEAD;HEAD.val=0;autoptr=&HEAD;for(inti=0;ival=i;ptr->ne

file - 在 Kotlin 中创建一个 ZIP 文件

我正在尝试在Kotlin中创建一个zip文件。这是代码:funmain(args:Array){varfiles:Array=arrayOf("/home/matte/theres_no_place.png","/home/matte/vladstudio_the_moon_and_the_ocean_1920x1440_signed.jpg")varout=ZipOutputStream(BufferedOutputStream(FileOutputStream("/home/matte/Desktop/test.zip")))vardata=ByteArray(1024)for(f

file - 在 Kotlin 中创建一个 ZIP 文件

我正在尝试在Kotlin中创建一个zip文件。这是代码:funmain(args:Array){varfiles:Array=arrayOf("/home/matte/theres_no_place.png","/home/matte/vladstudio_the_moon_and_the_ocean_1920x1440_signed.jpg")varout=ZipOutputStream(BufferedOutputStream(FileOutputStream("/home/matte/Desktop/test.zip")))vardata=ByteArray(1024)for(f

C++ zip 可变参数模板

这是C++中的一个简单的双容器zip函数:templatestd::list>simple_zip(conststd::list&lhs,conststd::list&rhs){std::list>result;for(std::pair::const_iterator,typenamestd::list::const_iterator>iter=std::pair::const_iterator,typenamestd::list::const_iterator>(lhs.cbegin(),rhs.cbegin());iter.first!=lhs.end()&&iter.secon

c++ - g++:使用 ZIP 文件作为输入

我们身边有Boost库。它由大量永远不会更改的文件组成,并且只使用其中的一小部分。如果我们要更改版本,我们会交换整个boost目录。目前,我们的SVN中有Boost源,逐个文件,这使得结帐操作非常缓慢,尤其是在Windows上。如果有一个符号/插件来处理ZIP文件中的C++文件,那就太好了,比如://@ZIPFSASSIGN'boost''boost.zip/boost'#includeg++是否支持编译器Hook?是否有任何关于ZIP支持的努力?其他想法? 最佳答案 我假设make或类似的构建系统参与构建您的软件的过程。我会将zi

c++ - “The procedure entry point… could not be located” 在错误的 DLL 中

我已经从Haskell代码创建了一个DLL,我正在从C++调用这个DLL。当我在VisualStudio2010中以Debug模式运行时,我的应用程序工作正常,但是当我制作发布版本并安装它时,出现错误TheprocedureentrypointGetDataChunkcouldnotbelocatedinthedynamiclinklibraryAdvancedMath.dll.AdvancedMath.dll是我基于Haskell的DLL。奇怪的是函数GetDataChunk不在那个DLL中——它在我链接的另一个DLL中,而当我添加HaskellDLL时,那个DLL或我的应用程序对它

C++ 虚函数 : Can the linker remove entries in the virtual function table which aren't called?

这个问题是对eliminateunusedvirtualfunctions的一种跟进,这对我的兴趣来说还不够深入。问题:在定义具有虚函数的类时,编译器为虚函数表分配存储空间,并在表中存储指向函数的指针。这会导致链接器保留这些函数的代码,而不管它们是否被调用过。这可能会导致大量死代码保留在可执行文件中,即使编译器优化设置要求消除死代码也是如此。现在,如果在可执行文件中没有任何地方有特定虚函数的调用(或者换句话说,访问虚函数表的相应槽),则可以从虚函数中省略相应的函数指针表,链接器将删除该函数的代码,并可能进一步省略其他未引用的代码。显然,这不能由编译器完成,因为只有在链接时才会清楚是否调

c++ - boost zip 迭代器和 std::sort

我有两个长度相同的数组values和keys。我想使用keys数组作为键对values数组进行按键排序。有人告诉我,boost的zip迭代器是将两个数组锁定在一起并同时对它们执行操作的正确工具。这是我尝试使用boost::zip_iterator来解决无法使用gcc编译的排序问题。有人可以帮我修复这段代码吗?问题出在线路上std::sort(boost::make_zip_iterator(keys,values),boost::make_zip_iterator(keys+N,values+N));#include#include#include#include#include#in