[Compbench-devel] CompBenchmarks++/UI UI.cpp,1.6,1.7 UI.h,1.4,1.5
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-01-18 18:43:29
|
Update of /cvsroot/compbench/CompBenchmarks++/UI In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18642 Modified Files: UI.cpp UI.h Log Message: CBM namespace. Index: UI.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/UI/UI.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UI.h 2 Oct 2006 19:08:26 -0000 1.4 --- UI.h 18 Jan 2007 18:43:25 -0000 1.5 *************** *** 12,85 **** #include <string> ! /** \brief Basic API for user interface. ! * ! * This class defines few methods to interact with compbenchmarks-config, or ! * with the console. ! */ ! class CBMUI ! { ! private: ! protected: ! /** Unused for now. */ ! std::string progressMsg; ! /** Unused for now. */ ! int progressMax; ! /** Unused for now. */ ! int progressCur; ! public: ! CBMUI(); ! /** Typedef for message sent to UI object. */ ! typedef enum Info { FileCreate, /*!< File creation */ ! FileRead, /*!< File is being read */ ! FileWrite, /*!< File has been written */ ! FileRemove, /*!< File has been removed */ ! ChecksumOK, /*!< Correct checksum message */ ! ChecksumFailed, /*!< Bad checksum */ ! DirectoryCheck, /*!< Directory has been checked */ ! DirectoryCreate, /*!< Directory has been created */ ! BenchDownload, /*!< Benchmark downloaded */ ! BenchExtract, /*!< Benchmark extracted */ ! BenchPatch, /*!< Benchmark patched */ ! BenchPreconfigure, /*!< Benchmark pre-configured */ ! BenchConfigure, /*!< Benchmark configured */ ! BenchMake, /*!< Benchmark (package) build */ ! BenchTest, /*!< Benchmark is tested */ ! BenchBench, /*!< Benchmark ran */ ! BenchResult, /*!< Benchmark result is being ! * displayed */ ! BenchClean, /*!< Package has been cleaned */ ! BenchUninstall /*!< Package uninstalled */ ! }; ! /** Throws a fatal error. ! Display a message and exits properly. ! \sa CBMSystem::done() ! \return 1 if ok. ! */ ! virtual int Fatal(std::string msg); ! /** Display information. ! Prints an header corresponding to the type, then shows msg. ! \param type Type of information ! \param msg Message (clear text) to display ! */ ! virtual int Information(Info type, ! std::string msg); ! /* ! virtual int ProgressInit(std::string& msg, ! int max) = 0; ! virtual int Progress(int step) = 0; ! virtual int ProgressDone(void) = 0; ! */ ! /** Virtual destructor */ ! virtual ~CBMUI(); ! }; ! extern CBMUI *UI; #endif --- 12,87 ---- #include <string> ! namespace CBM { ! /** \brief Basic API for user interface. ! * ! * This class defines few methods to interact with compbenchmarks-config, or ! * with the console. ! */ ! class UI ! { ! private: ! protected: ! /** Unused for now. */ ! std::string progressMsg; ! /** Unused for now. */ ! int progressMax; ! /** Unused for now. */ ! int progressCur; ! public: ! UI(); ! /** Typedef for message sent to UI object. */ ! typedef enum Info { FileCreate, /*!< File creation */ ! FileRead, /*!< File is being read */ ! FileWrite, /*!< File has been written */ ! FileRemove, /*!< File has been removed */ ! ChecksumOK, /*!< Correct checksum message */ ! ChecksumFailed, /*!< Bad checksum */ ! DirectoryCheck, /*!< Directory has been checked */ ! DirectoryCreate, /*!< Directory has been created */ ! BenchDownload, /*!< Benchmark downloaded */ ! BenchExtract, /*!< Benchmark extracted */ ! BenchPatch, /*!< Benchmark patched */ ! BenchPreconfigure, /*!< Benchmark pre-configured */ ! BenchConfigure, /*!< Benchmark configured */ ! BenchMake, /*!< Benchmark (package) build */ ! BenchTest, /*!< Benchmark is tested */ ! BenchBench, /*!< Benchmark ran */ ! BenchResult, /*!< Benchmark result is being ! * displayed */ ! BenchClean, /*!< Package has been cleaned */ ! BenchUninstall /*!< Package uninstalled */ ! }; ! /** Throws a fatal error. ! Display a message and exits properly. ! \sa CBMSystem::done() ! \return 1 if ok. ! */ ! virtual int Fatal(std::string msg); ! /** Display information. ! Prints an header corresponding to the type, then shows msg. ! \param type Type of information ! \param msg Message (clear text) to display ! */ ! virtual int Information(Info type, ! std::string msg); ! /* ! virtual int ProgressInit(std::string& msg, ! int max) = 0; ! virtual int Progress(int step) = 0; ! virtual int ProgressDone(void) = 0; ! */ ! /** Virtual destructor */ ! virtual ~UI(); ! }; ! extern UI *cbmUI; ! } #endif Index: UI.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/UI/UI.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UI.cpp 10 Jan 2007 20:28:48 -0000 1.6 --- UI.cpp 18 Jan 2007 18:43:25 -0000 1.7 *************** *** 5,11 **** #include <iostream> ! CBMUI *UI = 0; ! CBMUI::CBMUI() { progressMsg=""; --- 5,13 ---- #include <iostream> ! using namespace CBM; ! CBM::UI *cbmUI = 0; ! ! UI::UI() { progressMsg=""; *************** *** 14,22 **** } ! int CBMUI::Fatal(std::string msg) { std::cerr << "FATAL ERROR: " << msg << std::endl; if (UO_fatal) { ! cbmSystem->done(); exit(1); } --- 16,24 ---- } ! int UI::Fatal(std::string msg) { std::cerr << "FATAL ERROR: " << msg << std::endl; if (UO_fatal) { ! CBM::cbmSystem->done(); exit(1); } *************** *** 24,29 **** } ! int CBMUI::Information(Info type, ! std::string msg) { std::string what; --- 26,31 ---- } ! int UI::Information(CBM::UI::Info type, ! std::string msg) { std::string what; *************** *** 97,101 **** } ! CBMUI::~CBMUI() { } --- 99,103 ---- } ! UI::~UI() { } |