Commit 9ab86e13 authored by Johnny Jazeix's avatar Johnny Jazeix
Browse files

Ajout d'un Doxygen global.

Ajout de constructeurs par défaut pour les types.
Début de déboggage du parser d'évenements.
parent fc6d809b
This diff is collapsed.
......@@ -12,10 +12,12 @@
#
###
DIR_PARSER = parser
all:
cd interface/src && qmake-qt4 && make
@(cd $(DIR_PARSER) && make)
@echo " "
@echo "Compilation completed! File created in 'bin' folder."
@echo " "
......@@ -30,6 +32,7 @@ doc:
debugs:
cd interface && make debugs
@(cd $(DIR_PARSER) && make debug)
@echo " "
@echo "Compilation completed! (debug)"
@echo " "
......@@ -45,4 +48,5 @@ clean:
# Must be called with option -i, otherwise an error occured in the first instructions, the followings won't be executed.
wash:
cd interface && make clean
cd bin && rm *
@(cd $(DIR_PARSER) && make_clean)
cd bin && $(RM) *
######################################################################
# Automatically generated by qmake (2.01a) Tue Feb 3 22:27:18 2009
# Automatically generated by qmake (2.01a) dim. fvr. 8 15:58:07 2009
######################################################################
TARGET = vite
RESOURCES= vite.qrc
SOURCES+=../../main.cpp
OBJECTS_DIR=../bin
DESTDIR=../../bin
CONFIG+=uitools
QT+=opengl
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
......
DIR_SRC = src
DIR_TESTS = tests
all:
@(cd $(DIR_SRC) && make)
debug:
@(cd $(DIR_TESTS) && make)
clean:
@(cd $(DIR_SRC) && make clean)
@(cd $(DIR_TESTS) && make clean)
rm -rf makefile~
......@@ -25,7 +25,7 @@ void Definition::print(){
}
vector<field> &Definition::get_fields() const{
const vector<field> &Definition::get_fields() const{
return _fields;
}
......
......@@ -11,15 +11,17 @@
*/
#include <string>
struct field{
std::string _name;
std::string _type;
};
class Definition{
private:
struct field{
std::string _name;
std::string _type;
};
std::vector<field> _fields;
std::string _event_name;
......@@ -60,7 +62,7 @@ public:
* \brief : get_fields() : return the vector _fields
*
*/
std::vector<field> &get_fields() const;
const std::vector<field> &get_fields() const;
std::string get_event_name() const;
};
......
......@@ -58,7 +58,7 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
int i=1;
vector<field> fields = definition.get_fields();
int number_of_values fields.size();
int number_of_values = fields.size();
while(i < number_of_values) {
......@@ -68,24 +68,24 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
return;
}
if (fields[i-1].name == "Alias") {
if(!String::instanciate(current_value, alias)) {
if (fields[i-1]._name == "Alias") {
if(alias = current_value) {
cout << "warning : incompatible value" << endl;
return;
}
alias_is_initialized = true;
}
if (fields[i-1].name == "Name") {
if(!String::instanciate(current_value, name)) {
if (fields[i-1]._name == "Name") {
if(name = current_value) {
cout << "warning : incompatible value" << endl;
return;
}
name_is_initialized = true;
}
if (fields[i-1].name == "ContainerType") {
if(!String::instanciate(current_value, container_type)) {
if (fields[i-1]._name == "ContainerType") {
if(container_type = current_value) {
cout << "warning : incompatible value" << endl;
return;
}
......@@ -95,7 +95,7 @@ void ParserEventDecoder::store_event(const Definition &definition,Line &line, Tr
i++;
}
if(line.size > i) {
if(line.length() > i) {
cout << "warning : extra value(s)" << endl;
}
......
#include "date.hpp"
Date::Date(){
_value = 0.0;
}
Date::Date(double value){
_value = value;
}
......
......@@ -26,9 +26,12 @@ private :
public:
/*!
*
* \brief Constructor
*
*/
Date();
/*!
* \brief Constructor
*/
Date(double);
......
#include "double.hpp"
Double::Double(){
_value = 0.0;
}
Double::Double(double value){
_value = value;
}
......
......@@ -26,9 +26,12 @@ private :
public:
/*!
*
* \brief Constructor
*
*/
Double();
/*!
* \brief Constructor
*/
Double(double);
......
#include "string.hpp"
String::String(){
_value.erase();
}
String::String(std::string value){
_value = value;
......@@ -12,3 +15,8 @@ std::string String::to_string() const{
bool String::operator ==(const std::string &s) const{
return (_value==s);
}
String String::operator =(const std::string &s){
_value = s;
return *this;
}
......@@ -24,21 +24,30 @@ private:
public:
/*!
*
* \brief Constructor
*
*/
String(std::string);
String();
/*!
* \brief Constructor
*/
String(std::string);
/*!
*
* \fn to_string
*
*/
std::string to_string() const;
/*!
* \fn operator ==
*/
bool operator ==(const std::string &) const;
/*!
* \fn operator =
*/
String operator= (const std::string &);
};
#endif // STRING_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