Commit 501c677b authored by Johnny Jazeix's avatar Johnny Jazeix

Correction supplementaire sur l'avancement (finalement...)

parent 86a45c0d
......@@ -9,7 +9,7 @@ void Progress_bar_thread::run() {
int loaded = 0;
while(loaded < 99) {
while(!_parser->is_end_of_parsing()) {
loaded = _parser->get_size_loaded();
sleep(1); // We wait 1 second
QApplication::processEvents();
......
......@@ -39,6 +39,12 @@ public:
*/
virtual int get_size_loaded() const = 0;
/*!
* \fn is_end_of_parsing() const
* \brief true is the parsing is finished
* \return boolean
*/
virtual bool is_end_of_parsing() const = 0;
};
#endif // PARSER_HPP
......@@ -3,7 +3,7 @@
using namespace std;
void ParserPaje::parse(string filename, Trace &trace){
_is_finished = false;
// If the file must have the extension .trace
//
const unsigned int position_of_dot = filename.find_last_of('.');
......@@ -54,6 +54,8 @@ void ParserPaje::parse(string filename, Trace &trace){
trace.finish();
_is_finished = true;
// We print the warnings and errors
Error::print_numbers();
Error::flush_in_file("log.txt");
......@@ -76,3 +78,7 @@ void ParserPaje::reinit_cursor() {
TokenSource::reinit_cursor();
}
bool ParserPaje::is_end_of_parsing() const{
return _is_finished;
}
......@@ -34,7 +34,7 @@
class ParserPaje : public Parser{
private:
std::string _file_to_parse;
bool _is_finished;
public:
/*!
* \fn parse(std::string filename, Trace &trace)
......@@ -65,6 +65,13 @@ public:
*/
void reinit_cursor();
/*!
* \fn is_end_of_parsing() const
* \brief true is the parsing is finished
* \return boolean
*/
bool is_end_of_parsing() const;
};
#endif // PARSERPAJE_HPP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment