|
From: Ermete G. <ex...@li...> - 2003-07-09 22:52:25
|
<html>
<blockquote type=cite class=cite cite>- add:
PAQSolidFileManipulator::setEndOfFile to change file size (trunc <br>
useless data to do not waste space)</blockquote><br>
This was intented to be used only by the .FAT manager to truncate the
file if the size of the new saved one is smaller than before. But this
can be ignored till we do the defragmentation... so ok this function if
useless ^_^<br><br>
I've not understood why the use of the pair is forbidden... what are
public attributes?<br>
The variables are set to private, which are not visible in derived
classes too..<br><br>
I think I have made a mistake posting the .cpp files so early. The code
is pretty young, it is intended only to show a sort of work-flow of the
functions, to clearify what they do.<br>
Later in development I'll revise all the code and I am intentioned to try
to remove the for() cycles for searching etc. and replace them with the
STL templates, if this will be enough clear in the code. For
example<br>
<b>Before:<br>
</b><i><x-tab> </x-tab>UInt32
size;<br>
<x-tab> </x-tab>size =
this->freeSolidFileManipulators.size();<br>
<x-tab> </x-tab>for(Index
i=0;i<size;i++)<br>
<x-tab> </x-tab><x-tab> </x-tab>delete
this->freeSolidFileManipulators[i];<br>
<x-tab> </x-tab>this->freeSolidFileManipulators.clear();<br>
</i><b>After:<br>
</b><i><x-tab> </x-tab>vector<PAQSolidFileManipulator
*>::iterator begin,end;<br>
<x-tab> </x-tab>begin =
this->freeSolidFileManipulators.begin();<br>
<x-tab> </x-tab>end =
this->freeSolidFileManipulators.end();<br>
</i><x-tab> </x-tab><i>std::for_each(begin,end,deleteSolidManipulator());<br><br>
</i>The disadvantage is that I have to write additional things to make it
work. In the previous example I must add too:<br>
<i><x-tab> </x-tab>struct
deleteSolidManipulator : public
std::unary_function<PAQSolidFileManipulator *,void><br>
<x-tab> </x-tab>{<br>
<x-tab> </x-tab><x-tab> </x-tab>deleteSolidManipulator::result_type
operator()(deleteSolidManipulator::argument_type x) { delete x; };<br>
<x-tab> </x-tab>};<br>
</i>I personally think the second code if more clear, expecially with the
searching. But a person who doesn't know STL may find it difficult to
understand. Tell me what you think about it.<br><br>
Anyway, the modifications you posted has been applied.<br>
Thanks<br><br>
I'd like to say something on the networklib... but I had a quick read at
the headers and I found nothing missing :-)<br><br>
Exio82<br>
</html>
|