#include "JDV0-bis.h" #include #include #include #include using namespace std; void JeuDeLaVie::nettoie(std::string &s){ size_t pos=s.find_first_of("#"); s=s.substr(0,pos); int beg=0,end=s.size()-1; while(begbeg-1 && (s[end]==' ' || s[end]=='\t' )) end--; s=s.substr(beg,end-beg+1); } bool JeuDeLaVie::findCleVal(std::string &s, std::string &s1,std::string &s2){ nettoie(s); if (s==string("")) return false; size_t pos=s.find_first_of(":"); if (pos==string::npos) { cerr << "Le fichier est mal formé" << endl; terminate(); } s1=s.substr(0,pos); s2=s.substr(pos+1); nettoie(s1); nettoie(s2); //cerr<<"Found cle/val -> "<< s1<< " and "< "< " << (++i < argc ? argv[i] : "Erreur"); } else { cout << "Cette option n'a pas été reconnue."; opt_error = true; } cout << endl; } i++; } if (opt_error) { cout << "Usage : " << argv[0] << " [Options]" << endl; opts.print(); terminate(); } }