Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » something abaut brc file
something abaut brc file [message #8338] Sat, 03 March 2007 15:15 Go to next message
mubeta is currently offline  mubeta
Messages: 77
Registered: October 2006
Member
Hi,
I think there is some problem in the U++ "brc/ship" tutorial package. Compiling the original file I get error abaut MemReadStream....; in fact this class don't return any String or Stream pointer. Now I am using the String object:

BZ2Decompress(String(root_all[i], root_all_length[i])) ...

(But why there is so many binary container in u++??)

At the same time, using Progress for show a friendly decompression status, the bar restart from zero foe every decompressed file, so I write this code:

// header
class MyProgress : public Progress {
private:
int ts, pp;

public:
void SetMax(int max);
void SetLev(int lev);

bool PartialProgress(int par, int tot);

operator Gate2<int, int>() { return callback(this, &MyProgress::PartialProgress); }

typedef MyProgress CLASSNAME;

};

// cpp
void MyProgress::SetMax(int max) {

ts = max;
return;
}

void MyProgress::SetLev(int lev) {

pp = lev;
Set(pp, ts);
Refresh();
return;
}

bool MyProgress::PartialProgress(int par, int tot) {

double k = (double)ts / (double)tot;
int p = fceil(par / k);
Set(pp+p, ts);
Refresh();

return false;
}

...

// Package part

MyProgress p;
int ts = 0;
int pg = 0;
for(int i = 0; i < root_all_count; i++) ts += root_all_length[i];

p.SetMax(ts);
p.SetLev(0);
p.Title("Installazione in corso");
p.AlignText(Ctrl::LEFT);
RealizePath(installPath + "\\1.5\\");
for(int i = 0; i < root_all_count; i++) {
p.SetText(root_all_files[i]);
if(!SaveFile(installPath + "\\1.5\\" + root_all_files[i], BZ2Decompress(String(root_all[i], root_all_length[i]), p))) {
Exclamation("Errore. Pacchetto di installazione incompleto !");
return;
}
pg += root_all_length[i];
p.SetLev(pg);
}


With many files at the same directory, where one it's much more big the all others, the original progress indicator never show the real decompression status. Using PartialProgress, the percentage bar is much more linear.

Last. brc file is not recompiled if the source file it's changed. How to make it sensitive at the new file??

Mauro Bottizzo.
Re: something abaut brc file [message #8340 is a reply to message #8338] Sat, 03 March 2007 16:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Please, could you post packed package with this testcase?

Mirek
Re: something abaut brc file [message #8341 is a reply to message #8340] Sat, 03 March 2007 17:47 Go to previous messageGo to next message
mubeta is currently offline  mubeta
Messages: 77
Registered: October 2006
Member
No Message Body
  • Attachment: E011Setup.zip
    (Size: 54.53KB, Downloaded 311 times)
Re: something abaut brc file [message #8355 is a reply to message #8338] Mon, 05 March 2007 00:45 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mubeta wrote on Sat, 03 March 2007 09:15

Hi,
I think there is some problem in the U++ "brc/ship" tutorial package. Compiling the original file I get error abaut MemReadStream....; in fact this class don't return any String or Stream pointer. Now I am using the String object:

BZ2Decompress(String(root_all[i], root_all_length[i])) ...

(But why there is so many binary container in u++??)



MemReasStream is not container, but Stream. The error in brc/ship is definitely there; now fixed (it is GCC/MSC compatibility issue, more specifically, it is MSC allowing nonstandard C++ construct).

Quote:


At the same time, using Progress for show a friendly decompression status, the bar restart from zero foe every decompressed file, so I write this code:



Yes, a good idea.

Quote:


Last. brc file is not recompiled if the source file it's changed. How to make it sensitive at the new file??



In package organizer, click on the .brc file, then right-click the right array and choose "Add dependencies" to specify files it depends on.

Mirek
Previous Topic: How to use FileStream?
Next Topic: Derivating from Vector<>
Goto Forum:
  


Current Time: Sat Apr 20 13:15:26 CEST 2024

Total time taken to generate the page: 0.04113 seconds