Changeset dd04119a in tol
- Timestamp:
- Jun 7, 2012, 4:19:45 PM (14 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 67cbe29
- Parents:
- 3e5b4f1
- File:
-
- 1 edited
-
tol/btol/set_type/setgrainc.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/set_type/setgrainc.cpp
r3e5b4f1 rdd04119a 149 149 statusTable_.ReallocBuffer(size); 150 150 } 151 #ifndef NDEBUG 151 152 int pos = statusTable_.FindSorted(this, StatusTableCmp); 152 153 assert(pos<0); 154 #endif 153 155 statusTable_.AddSorted(this,StatusTableCmp); 154 156 } … … 273 275 file_ (), 274 276 busy_ (false), 277 oldSourcePath_(NULL), 275 278 curSourcePath_(NULL), 276 oldSourcePath_(NULL),277 279 makeGlobal_(NULL) 278 280 { … … 284 286 PutDescription(tolPath_); 285 287 #endif 288 // std::cout << "BSetFromFile::BSetFromFile :" << tolPath_ << "," << BGrammar::Level() <<"\n"; 286 289 if(BGrammar::Level()==0) 287 290 { … … 302 305 file_ (), 303 306 busy_ (false), 307 oldSourcePath_(NULL), 304 308 curSourcePath_(NULL), 305 oldSourcePath_(NULL),306 309 makeGlobal_(NULL) 307 310 { … … 331 334 //-------------------------------------------------------------------- 332 335 { 336 // std::cout << "BSetFromFile::~BSetFromFile: \n"; 333 337 TRACE_MEMORY_SHOW(this,"BSetFromFile::~BSetFromFile"); 334 338 BinWrite(); … … 906 910 BArray<BText> expression; 907 911 ReadAllTokens(section[section.Size()-1], expression, ';'); 908 BSyntaxObject* object ;912 BSyntaxObject* object = NULL; 909 913 BGrammar* gra = NIL; 910 914 BGrammar::PutLast(GraSet()); … … 992 996 } 993 997 998 //-------------------------------------------------------------------- 999 DeclareContensClass(BSet, BSetFromFile, BSetIncludeOZA); 1000 DefExtOpr(1, BSetIncludeOZA, "IncludeOZA", 1, 1, "Text", 1001 I2("(Text fileName)", 1002 "(Text nombreFichero)"), 1003 I2("Load an oza file, returning a Set with the elements " 1004 "contained in the oza file." 1005 , 1006 "Cargar un archivo oza, retornando un Set con los " 1007 "elementos contenidos en el archivo oza.Devuelve el " 1008 "conjunto de todos los objetos de un fichero TOL."), 1009 BOperClassify::FileIncluding_); 1010 //-------------------------------------------------------------------- 1011 void BSetIncludeOZA::CalcContens() 1012 //-------------------------------------------------------------------- 1013 { 1014 const BText &name = Text(Arg(1)); 1015 BSyntaxObject *oisload = GraSet()->EvaluateExpr(BText("Ois.Load(\"")+name+"\")[1]"); 1016 if ( oisload ) { 1017 const BSet &_oisdata = Set(oisload); 1018 contens_.Copy( _oisdata ); 1019 DESTROY( oisload ); 1020 contens_.PutSourcePath(curSourcePath_); 1021 } 1022 } 994 1023 995 1024 //-------------------------------------------------------------------- … … 1482 1511 GetLine(File(), line, MaxLineLength, '\n'); 1483 1512 firstDate = format.TextToDate(line.Compact()); 1484 if( dating=Tms(GraTimeSet()->EvaluateExpr(datingName)))1513 if((dating=Tms(GraTimeSet()->EvaluateExpr(datingName)))) 1485 1514 { 1486 1515 if(!firstDate.HasValue() || !dating->Contain(firstDate)) … … 1593 1622 BInt n; 1594 1623 BInt numLine=0; 1595 BBool lastComma = BFALSE;1624 //BBool lastComma = BFALSE; 1596 1625 BText errMsg=BST; 1597 1626 BText txt(MaxLineLength,' '); … … 1877 1906 BText extension = ToLower(GetFileExtension(name)); 1878 1907 BText autoPath = BOis::AutoPath(name); 1879 BBool isOis = false; 1880 if(extension=="") 1881 { 1882 isOis = CheckIsFile(autoPath+"/header.xml"); 1883 } 1884 else if(extension=="oza") 1885 { 1886 isOis = CheckIsFile(autoPath); 1887 } 1888 if(isOis) 1889 { 1890 result=GraSet()->EvaluateExpr(BText("Ois.Load(\"")+name+"\")[1]"); 1891 } 1892 if(!result && (BGrammar::Level()==0)) 1893 { 1894 result = (BSyntaxObject*)BSetFromFile::FindCompiled(name); 1895 if(result && (result->Level()>0)) { result = NULL; } 1896 } 1897 if( result) { DESTROY(arg); } 1898 else 1899 { 1900 if(extension=="prj") { result=new BSetIncludePRJ(arg); } 1901 else if(extension=="in") { result=new BSetIncludeTOL(arg); } 1902 else if(extension=="tol") { result=new BSetIncludeTOL(arg); } 1903 else if(extension=="bst") { result=new BSetIncludeBST(arg); } 1904 else if(extension=="bdt") { result=new BSetIncludeBDT(arg); } 1905 else if(extension=="bdc") { result=new BSetIncludeBDC(arg); } 1906 else if(extension=="bsi") { result=new BSetIncludeBSI(arg); } 1907 else if(extension=="bmt") { result=new BSetIncludeBMT(arg); } 1908 else if(BDir(name).IsDir()) 1909 { 1908 1909 BBool isDir = BDir(name).IsDir(); 1910 if(extension=="prj") { result=new BSetIncludePRJ(arg); } 1911 else if(extension=="in") { result=new BSetIncludeTOL(arg); } 1912 else if(extension=="tol") { result=new BSetIncludeTOL(arg); } 1913 else if(extension=="bst") { result=new BSetIncludeBST(arg); } 1914 else if(extension=="bdt") { result=new BSetIncludeBDT(arg); } 1915 else if(extension=="bdc") { result=new BSetIncludeBDC(arg); } 1916 else if(extension=="bsi") { result=new BSetIncludeBSI(arg); } 1917 else if(extension=="bmt") { result=new BSetIncludeBMT(arg); } 1918 else if(extension=="oza" || (isDir && CheckIsFile(autoPath+"/header.xml"))) { result= new BSetIncludeOZA(arg); } 1919 else if( isDir ) 1920 { 1910 1921 result=new BSetIncludeDIR(arg); 1911 1922 } 1912 else1923 else 1913 1924 { 1914 1925 Error(I2("Unknown file type ","Tipo de fichero desconocido ")+"\""+name+"\""); 1915 1926 DESTROY(arg); 1916 1927 } 1917 BText p;1918 BText ok = I2("Included","Ha sido incluido");1919 if(result)1920 {1921 double tm1 = (double)time(0);1922 p = result->TolPath();1923 Set(result);1928 BText p; 1929 BText ok = I2("Included","Ha sido incluido"); 1930 if(result) 1931 { 1932 //double tm1 = (double)time(0); 1933 p = result->TolPath(); 1934 Set(result); 1924 1935 if(!CheckIsFile(p) && !BDir::CheckIsDir (p)) 1925 {1926 ok = I2("NOT included","No ha sido incluido");1927 }1928 }1929 else1936 { 1937 ok = I2("NOT included","No ha sido incluido"); 1938 } 1939 } 1940 else 1930 1941 { 1931 1942 p = name; 1932 1943 ok = I2("NOT included","No ha sido incluido"); 1933 1944 } 1934 if(show_msg_included)1945 if(show_msg_included) 1935 1946 { 1936 1947 Std(ok+I2(" file ", " el fichero ")+p+" ["+BDat((double)tm.MSec()/1000.0).Format("%.3lf")+" sec.]\n"); 1937 1948 } 1938 }1939 1949 int nErr1 = (int)TOLErrorNumber().Value(); 1940 1950 BSetFromFile* sff = (BSetFromFile*)result;
Note: See TracChangeset
for help on using the changeset viewer.
