Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
vite
Commits
1f02df15
Commit
1f02df15
authored
Mar 05, 2009
by
Johnny Jazeix
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout des erreurs par l'interface console.
parent
0f2ac4fd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
11 deletions
+49
-11
src/interface/interface.hpp
src/interface/interface.hpp
+4
-1
src/interface/interface_console.cpp
src/interface/interface_console.cpp
+4
-0
src/interface/interface_console.hpp
src/interface/interface_console.hpp
+6
-0
src/interface/interface_graphic.cpp
src/interface/interface_graphic.cpp
+7
-3
src/interface/interface_graphic.hpp
src/interface/interface_graphic.hpp
+6
-0
src/parser/Errors.cpp
src/parser/Errors.cpp
+21
-7
src/parser/Errors.hpp
src/parser/Errors.hpp
+1
-0
No files found.
src/interface/interface.hpp
View file @
1f02df15
...
...
@@ -41,7 +41,10 @@ class Interface{
*/
virtual
void
information
(
const
std
::
string
)
const
=
0
;
/*!
\brief Return the name of the file opened.
*/
virtual
const
std
::
string
get_filename
()
const
=
0
;
};
#endif
src/interface/interface_console.cpp
View file @
1f02df15
...
...
@@ -344,3 +344,7 @@ void Interface_console::warning(const string s) const{
void
Interface_console
::
information
(
const
string
s
)
const
{
cerr
<<
s
<<
endl
;
}
const
string
Interface_console
::
get_filename
()
const
{
return
_file_opened
;
}
src/interface/interface_console.hpp
View file @
1f02df15
...
...
@@ -197,6 +197,12 @@ protected:
int
run
();
/*!
* \brief Get the name of the current trace file.
*
*/
const
std
::
string
get_filename
()
const
;
/***********************************
*
...
...
src/interface/interface_graphic.cpp
View file @
1f02df15
...
...
@@ -117,21 +117,21 @@ void Interface_graphic::load_windows(){
void
Interface_graphic
::
error
(
const
string
s
)
const
{
QString
buf
=
s
.
c_str
();
//_ui_info_trace_text->moveCursor(QTextCursor::Start
);/* Insert the new text on the beginning */
_ui_info_trace_text
->
moveCursor
(
QTextCursor
::
End
);
/* Insert the new text on the beginning */
_ui_info_trace_text
->
insertHtml
(
"<font color='red'>"
+
buf
+
"</font><br /><br />"
);
}
void
Interface_graphic
::
warning
(
const
string
s
)
const
{
QString
buf
=
s
.
c_str
();
//_ui_info_trace_text->moveCursor(QTextCursor::Start
);/* Insert the new text on the beginning */
_ui_info_trace_text
->
moveCursor
(
QTextCursor
::
End
);
/* Insert the new text on the beginning */
_ui_info_trace_text
->
insertHtml
(
"<font color='orange'>"
+
buf
+
"</font><br /><br />"
);
}
void
Interface_graphic
::
information
(
const
string
s
)
const
{
QString
buf
=
s
.
c_str
();
//_ui_info_trace_text->moveCursor(QTextCursor::Start
);/* Insert the new text on the beginning */
_ui_info_trace_text
->
moveCursor
(
QTextCursor
::
End
);
/* Insert the new text on the beginning */
_ui_info_trace_text
->
insertHtml
(
"<font color='green'>"
+
buf
+
"</font><br /><br />"
);
}
...
...
@@ -359,3 +359,7 @@ void Interface_graphic::on_main_window_hide(){
cerr
<<
"GoodBye"
<<
endl
;
}
const
std
::
string
Interface_graphic
::
get_filename
()
const
{
return
_trace_path
;
}
src/interface/interface_graphic.hpp
View file @
1f02df15
...
...
@@ -191,6 +191,12 @@ public:
void
information
(
const
std
::
string
)
const
;
/*!
* \brief Get the name of the current trace file.
*
*/
const
std
::
string
get_filename
()
const
;
...
...
src/parser/Errors.cpp
View file @
1f02df15
...
...
@@ -91,15 +91,24 @@ bool Error::set_and_print_warning_if(bool condition, string kind_of_error, unsig
void
Error
::
print_numbers_of_warning_and_errors
(){
message
<<
"Your trace has "
<<
Error
::
_errors
.
size
()
<<
" errors and "
<<
Error
::
_warnings
.
size
()
<<
" warnings."
<<
endi
;
message
<<
"Your trace has "
<<
Error
::
_errors
.
size
()
<<
" errors and "
<<
Error
::
_warnings
.
size
()
<<
" warnings."
;
if
(
Error
::
_warnings
.
size
()
==
0
&&
Error
::
_errors
.
size
()
==
0
){
message
<<
endi
;
}
else
if
(
Error
::
_errors
.
size
()
==
0
){
message
<<
endw
;
}
else
{
message
<<
ende
;
}
}
void
Error
::
flush_in_file
(
const
string
&
filename
){
if
(
_errors
.
empty
()
&&
_warnings
.
empty
()){
if
(
_errors
.
empty
()
&&
_warnings
.
empty
())
{
return
;
}
else
{
else
{
ofstream
outfile
(
filename
.
c_str
(),
ios
::
out
|
ios
::
trunc
);
const
int
number_of_errors
=
Error
::
_errors
.
size
();
...
...
@@ -110,9 +119,12 @@ void Error::flush_in_file(const string &filename){
return
;
}
else
{
outfile
<<
"File "
<<
filename
<<
endl
<<
endl
;
outfile
<<
"Errors :"
<<
endl
;
outfile
<<
"File "
<<
Message
::
get_interface_instance
()
->
get_filename
()
<<
endl
<<
endl
;
if
(
!
_errors
.
empty
()){
outfile
<<
"Errors :"
<<
endl
;
}
// Print the errors
while
(
!
_errors
.
empty
()){
outfile
<<
_errors
.
front
()
<<
endl
;
...
...
@@ -120,7 +132,9 @@ void Error::flush_in_file(const string &filename){
}
// Print the warnings
outfile
<<
endl
<<
"Warnings :"
<<
endl
;
if
(
!
_warnings
.
empty
()){
outfile
<<
endl
<<
"Warnings :"
<<
endl
;
}
while
(
!
_warnings
.
empty
()){
outfile
<<
_warnings
.
front
()
<<
endl
;
_warnings
.
pop
();
...
...
src/parser/Errors.hpp
View file @
1f02df15
...
...
@@ -11,6 +11,7 @@
#include <iostream>
#include <fstream>
#include "../message/message_ns.hpp"
#include "../interface/interface_graphic.hpp"
class
Error
{
private:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment