Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv30537
Modified Files:
CEL-Include.cpp CEL-Include.h
Log Message:
CEL Include paths can be set.
Attach included files to the <cel-include/> tag/object.
Index: CEL-Include.h
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL/CEL-Include.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CEL-Include.h 11 Mar 2007 18:47:49 -0000 1.2
--- CEL-Include.h 13 Mar 2007 17:43:28 -0000 1.3
***************
*** 14,17 ****
--- 14,19 ----
/** \brief ?
*/
+ void CelIncludePathAdd(std::string _path);
+
class CelInclude : public CelAtom {
protected:
Index: CEL-Include.cpp
===================================================================
RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/CEL/CEL-Include.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CEL-Include.cpp 11 Mar 2007 18:47:49 -0000 1.2
--- CEL-Include.cpp 13 Mar 2007 17:43:28 -0000 1.3
***************
*** 9,15 ****
--- 9,40 ----
#include <CEL/CEL-Include.h>
#include <CEL/CEL-Reader.h>
+ #include <System/System.h>
using namespace CBM;
+ std::vector<std::string> celincludespaths;
+
+ void CBM::CelIncludePathAdd(std::string _path)
+ {
+ celincludespaths.push_back(_path);
+ }
+
+ std::string CelFullIncludeName(std::string _relativeFN)
+ {
+ int i;
+ int n = celincludespaths.size();
+ std::string r;
+
+ for(i=0; i<n; i++) {
+ r=celincludespaths[i];
+ r+="/";
+ r+=_relativeFN;
+ if (cbmSystem->fileExists(r)) {
+ return(r);
+ }
+ }
+ return(_relativeFN);
+ }
+
CelInclude::CelInclude()
: CelAtom()
***************
*** 35,40 ****
for(i=0; i<n; i++) {
N=childs[i];
! CelReader R(N->Evaluate());
I=R.parse();
r=I->Evaluate();
}
--- 60,66 ----
for(i=0; i<n; i++) {
N=childs[i];
! CelReader R(CelFullIncludeName(N->Evaluate()));
I=R.parse();
+ add(I);
r=I->Evaluate();
}
|