Feature #1696

Updated by Abdelghani Omari almost 7 years ago

in the attached patch :
- update UnZip::ReadDir(): a file is added to the list only if all it's field are sets.
- add the possiblilty to load a file knowing it's path
- add search in the zip: Vector<String> UnZip::Search(String pattern)

currently,
actually, i have to do loop in each file in the zip in order to find a file knowing it's name.
<pre>
<code class="cpp">
while(!(unzip.IsEof() || unzip.IsError())) {
if(path == unzip.GetPath()))
s = unzip.ReadFile();
else
unzip.SkipFile();
}
</code>
</pre>
it's usefull if we add this overload:
<pre>
<code class="cpp">
String UnZip::ReadFile(const char* path, Gate<int, int> progress = Null)
{
for(int i = 0; i < file.GetCount(); i++)
{
if(file[i].path.IsEqual(path))
{
Seek(i);
return ReadFile( progress );
}
}

return String::GetVoid();
}

</code>
</pre>

then the call will be :
<pre>
<code class="cpp">
s = unzip.ReadFile(path);
</code>
</pre>

Back