#include "nomDeLogiciel.h" nomDeLogiciel::Logiciel nomDeLogiciel::fromString( std::string s) { if (s == "parmela" ) return parmela; else if ( s == "transport" ) return transport; else if ( s == "generator" ) return generator; else if ( s == "test" ) return test; return unknownSoftware; } std::string nomDeLogiciel::toString( nomDeLogiciel::Logiciel lg) { switch (lg) { case parmela : { return "parmela"; } case transport : { return "transport"; } case generator : { return "generator"; } case test : { return "test"; } case unknownSoftware : { return "unknownSoftware"; } } return "unknownSoftware"; } nomDeLogiciel::nomDeLogiciel() { program_ = transport; progString_ = toString(program_); // value_ = toValue(program_); } nomDeLogiciel::nomDeLogiciel(const string& s) { program_ = fromString(s); progString_ = toString(program_); // value_ = toValue(program_); } nomDeLogiciel::nomDeLogiciel(int val) { program_ = (Logiciel)val; progString_ = toString(program_); // program_ = fromValue(val); // value_ = toValue(program_); } int nomDeLogiciel::getNumberOfSoftwares() { // return toValue(unknownSoftware); return unknownSoftware; } // operators nomDeLogiciel& nomDeLogiciel::operator= (const nomDeLogiciel& nl) { program_ = nl.program_; progString_ = nl.progString_; // value_ = nl.value_; return *this; } bool nomDeLogiciel::operator== (const nomDeLogiciel& nl) { return ( program_ == nl.program_); } bool nomDeLogiciel::operator!= (const nomDeLogiciel& nl) { return ( program_ != nl.program_); }