#ifndef config_h #define config_h // config.h // buzz - Programme du robot Efrei Robotique I1-I2 2003 // Copyright (C) 2003 Nicolas Schodet class Config { const char *m_filename; int m_type; public: // Constructeur. Config (const char *filename); // Destructeur. ~Config (void); // Attend un token, sinon, jette une exception. int getNum (void); Config &operator>> (int &num) { num = getNum (); return *this; } const char *getId (void); Config &operator>> (const char *&s) { s = getId (); return *this; } bool getBool (void); Config &operator>> (bool &b) { b = getBool (); return *this; } double getFloat (void); Config &operator>> (double &fl) { fl = getFloat (); return *this; } void getEof (void); // Vérifie si le prochain token est... bool isId (const char *s); // Retourne true si ŕ la fin du fichier. bool eof (void); // Lance une erreur, on a pas trouvé ce qu'on voulais. void noId (void); }; #endif // config_h