Commit 93c51339 authored by Arthur Redondy's avatar Arthur Redondy
Browse files

ameliorations presentation et noms de variable

parent 0b03917a
......@@ -7,8 +7,11 @@
#define STRING 2
#define DATE 3
class Definition
{
/*! \class Definition Definition.hpp "../parser/src/Definition.hpp"
* Contains the definition of a definition.
*/
class Definition{
struct champs {
std::string name;
int type;
......@@ -33,7 +36,8 @@ public:
* \param : string event name
*
*/
Definition(String& eventname);
Definition(std::string& eventname);
/*!
* \brief : add a field to definition
* \param : name
......@@ -44,7 +48,7 @@ public:
/*!
* \brief : print() : debug
* \brief : print() : display the definitions
*
*
*/
......
......@@ -13,8 +13,8 @@ int stopnexttoken(int* cursor){
if (line[*cursor]!='"'){
while(line[cursor]!='"' || line[cursor]!='\n' || line[cursor]!='\0')
*cursor++;
return cursor
}
return cursor;
}
else{
while(line[cursor]!=' ' || line[cursor]!='\n' || line[cursor]!='\0')
cursor++;
......@@ -74,7 +74,7 @@ void Line::store(std::string s){
{
Line l;
l.store(s);
this == l;
return (this == l);
}
......
......@@ -21,8 +21,7 @@ private:
/*!
* \brief tokenize() divide into tokens
*
* \brief tokenize() divide into tokens
*/
void tokenize();
......
......@@ -8,21 +8,32 @@ int ParserDefinitionDecoder::definitions_number(){
void ParserDefinitionDecoder::store_definition(Line &line, ifstream &file){
//read header of one definition
//read the definition header
line.store(file);
Definition d = Definition(line.item(2));
Definitions[line.item(3)] = d;
//read list of parameters
string& definition_name = line.item(2);
string& definition_identity = line.item(3);
//store this header
Definition current_definition = Definition(definition_name);
Definitions[definition_identity] = current_definition;
string& field_type;
string& field_value;
//read and store the parameters list
while (line.store(file))
{
if(line == "%EndEventDef")
break;
if (line.length()!=3)
//warning();
if (line.length()!=3)//veririfer le % au lieu de tester le nombre de token
//ajouter un warning vers l'interface
;
d.store(line.item(1),line.item(2));
field_type = line.item(1);
field_value = line.item(2);
current_definition.store(field_type, field_value);
}
}
......
......@@ -18,8 +18,7 @@ private:
public:
int definitions_number();
void store_definition(Ligne &, ifstream &);
Definition& get_definition(int i);
//operator[](int i);
Definition& get_definition(int i);
};
......
Supports Markdown
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