Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 3f975943 authored by Arthur Redondy's avatar Arthur Redondy
Browse files

rectification de src.pro pour que ca compile merci clement et debut d'ajout de...

rectification de src.pro pour que ca compile merci clement et debut d'ajout de messages d'erreurs pour TokenSource
parent 2edd78f7
Branches
Tags
No related merge requests found
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include "../message/message_ns.hpp" #include "../message/message_ns.hpp"
#include "../interface/interface_graphic.hpp"
/*! \class Error /*! \class Error
* \brief Define errors and warnings used in the parser. * \brief Define errors and warnings used in the parser.
......
#include "TokenSource.hpp" #include "TokenSource.hpp"
using namespace std; using namespace std;
using namespace message_ns;
TokenSource::TokenSource(){ TokenSource::TokenSource(){
//no file are opened //no file are opened
...@@ -18,7 +19,7 @@ TokenSource::~TokenSource(){ ...@@ -18,7 +19,7 @@ TokenSource::~TokenSource(){
_file.close(); _file.close();
#else #else
if (munmap(_buffer, _filesize) == -1){ if (munmap(_buffer, _filesize) == -1){
perror("error : munmap"); message << "munmap error" << endw;
} }
close(_fd); close(_fd);
#endif #endif
...@@ -34,24 +35,24 @@ void TokenSource::open(const char *filename){ ...@@ -34,24 +35,24 @@ void TokenSource::open(const char *filename){
fill_buffer(); fill_buffer();
#else #else
if ((_fd = ::open(filename, O_RDONLY)) == -1){ if ((_fd = ::open(filename, O_RDONLY)) == -1){
perror("error : open file"); message << "open file error" << ende;
exit(-1); exit(-1);
} }
struct stat buf; struct stat buf;
if(fstat(_fd, &buf) == -1){ if(fstat(_fd, &buf) == -1){
perror("error status file"); message << "status file error" << ende;
exit(-1); exit(-1);
} }
_filesize = buf.st_size; _filesize = buf.st_size;
if(_filesize == 0){ if(_filesize == 0){
perror("empty file"); message << "empty file" << endw;
} }
if ((_buffer = (char *)mmap(0, _filesize, PROT_READ, MAP_PRIVATE, _fd, 0)) == MAP_FAILED){ if ((_buffer = (char *)mmap(0, _filesize, PROT_READ, MAP_PRIVATE, _fd, 0)) == MAP_FAILED){
perror("error mmap"); message << "mmap error" << ende;
exit(-1); exit(-1);
} }
#endif #endif
...@@ -95,14 +96,14 @@ void TokenSource::build_composite_token(){ ...@@ -95,14 +96,14 @@ void TokenSource::build_composite_token(){
#ifdef WIN32 #ifdef WIN32
if (_cursor == _buffer_size){ if (_cursor == _buffer_size){
if (!fill_buffer()){ if (!fill_buffer()){
cout << "found \" at end of file" << endl; message << "found \" at end of file" << endw;
return; return;
} }
_cursor = 0; _cursor = 0;
} }
#else #else
if (ensure_capacity()){ if (ensure_capacity()){
cout << "error :found \" at end of file" << endl; message << "found \" at end of file" << endw;
return; return;
} }
#endif #endif
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include <string> #include <string>
#include <iostream> #include <iostream>
#include "../message/message_ns.hpp"
#ifdef WIN32 // They do not have mmap #ifdef WIN32 // They do not have mmap
#define BUFFER_SIZE 2048 #define BUFFER_SIZE 2048
#define WORD_SIZE 64 #define WORD_SIZE 64
......
...@@ -37,7 +37,6 @@ message/endwarning.hpp \ ...@@ -37,7 +37,6 @@ message/endwarning.hpp \
trace/ContainerType.hpp \ trace/ContainerType.hpp \
trace/DrawTrace.hpp \ trace/DrawTrace.hpp \
trace/Entity.hpp \ trace/Entity.hpp \
trace/EntityList.hpp \
trace/EntityType.hpp \ trace/EntityType.hpp \
trace/EntityValue.hpp \ trace/EntityValue.hpp \
trace/Event.hpp \ trace/Event.hpp \
...@@ -80,7 +79,6 @@ SOURCES += message/enderror.cpp \ ...@@ -80,7 +79,6 @@ SOURCES += message/enderror.cpp \
trace/Container.cpp \ trace/Container.cpp \
trace/ContainerType.cpp \ trace/ContainerType.cpp \
trace/Entity.cpp \ trace/Entity.cpp \
trace/EntityList.cpp \
trace/EntityType.cpp \ trace/EntityType.cpp \
trace/EntityValue.cpp \ trace/EntityValue.cpp \
trace/Event.cpp \ trace/Event.cpp \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment