[Compbench-devel] CompBenchmarks++/libcompbenchmarks/Compiler Compiler-Options.cpp, 1.4, 1.5 Compil
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-05-30 17:01:25
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14208 Modified Files: Compiler-Options.cpp Compiler-Options.h Log Message: Identifier introduced. Few changes on XML I/O. Index: Compiler-Options.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler-Options.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Compiler-Options.h 17 May 2007 14:31:13 -0000 1.3 --- Compiler-Options.h 30 May 2007 17:01:12 -0000 1.4 *************** *** 27,30 **** --- 27,31 ---- */ std::vector<CBM::CompilerOption*> options; + std::string id; protected: *************** *** 36,40 **** \param _options Options to manage in current object. */ ! CompilerOptions(std::string _options = ""); virtual CompilerOption *Option(std::string _id); --- 37,44 ---- \param _options Options to manage in current object. */ ! CompilerOptions(std::string id, ! std::string _options = ""); ! ! virtual std::string Id(void); virtual CompilerOption *Option(std::string _id); Index: Compiler-Options.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Compiler/Compiler-Options.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Compiler-Options.cpp 23 May 2007 18:24:03 -0000 1.4 --- Compiler-Options.cpp 30 May 2007 17:01:12 -0000 1.5 *************** *** 12,20 **** using namespace CBM; ! CompilerOptions::CompilerOptions(std::string _options) { std::string o = "!"; int i = 0; if (_options=="") return; --- 12,22 ---- using namespace CBM; ! CompilerOptions::CompilerOptions(std::string _id, ! std::string _options) { std::string o = "!"; int i = 0; + id=_id; if (_options=="") return; *************** *** 31,34 **** --- 33,41 ---- } + std::string CompilerOptions::Id(void) + { + return(id); + } + void CompilerOptions::add(CBM::CompilerOption *_option) { *************** *** 117,120 **** --- 124,129 ---- root=new XMLNode("options"); + root->addAttribute("id", Id()); + for(i=0; i<n; i++) root->add(Option(i)->XML()); *************** *** 128,139 **** int n = _from->nodeNumber(); XMLNode *N; CompilerOption *O; for(i=0; i<n; i++) { N=_from->getNode(i); if (N->Name()=="option") { ! O=new CompilerOption; ! O->restore(N); ! add(O); } } --- 137,158 ---- int n = _from->nodeNumber(); XMLNode *N; + XMLAttribute *A; CompilerOption *O; + A=_from->getAttribute("id"); + if (A) + id=A->Value(); + else + id="?"; + for(i=0; i<n; i++) { N=_from->getNode(i); if (N->Name()=="option") { ! A=N->getAttribute("id"); ! if (A) { ! O=new CompilerOption(""); ! O->restore(N); ! add(O); ! } } } *************** *** 145,148 **** while ( (O=Option(0)) ) ! delete(O); } --- 164,167 ---- while ( (O=Option(0)) ) ! remove(O); } |