Changeset 84af815 in tol
- Timestamp:
- Mar 9, 2012, 3:54:00 PM (15 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 0fd52fc
- Parents:
- bfa6580
- Location:
- tol
- Files:
-
- 1 added
- 3 edited
-
bbasic/StringMatch.cpp (added)
-
bbasic/tol_btext.h (modified) (1 diff)
-
bbasic/txtalgeb.cpp (modified) (8 diffs)
-
btol/real_type/datgrav.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol/bbasic/tol_btext.h
rbfa6580 r84af815 386 386 387 387 //! Checks if a given pattern matchs with the actual text 388 BBool Match (const BText pattern, BBool caseSensitive=BFALSE) const;388 BBool Match (const BText &pattern, BBool caseSensitive=BFALSE) const; 389 389 390 390 //! Returns the wrapped text \a txt compacted -
tol/bbasic/txtalgeb.cpp
rbfa6580 r84af815 717 717 { 718 718 const BChar* beginText; 719 if( beginText = strstr(String() + from, txt.String()))719 if( (beginText = strstr(String() + from, txt.String())) ) 720 720 { 721 721 indexText = (beginText - String()); … … 849 849 number = 0; 850 850 BChar* pos=Buffer(); 851 while( pos=strchr(pos, oldChar))851 while( (pos=strchr(pos, oldChar)) ) 852 852 { 853 853 *pos = newChar; … … 907 907 txt.ReallocateBuffer(2*txt.Size()); 908 908 } 909 if( pos=strstr(Buffer()+oldPos, oldText.String()))909 if( (pos=strstr(Buffer()+oldPos, oldText.String())) ) 910 910 { 911 911 number++; … … 1062 1062 1063 1063 1064 //-------------------------------------------------------------------- 1065 BBool BText::Match(const BText pattern, BBool caseSensitive) const 1064 #include "StringMatch.cpp" 1065 1066 //-------------------------------------------------------------------- 1067 BBool BText::Match(const BText &pattern, BBool caseSensitive) const 1066 1068 1067 1069 /*! Returns true if the pattern \a pattern makes match with the … … 1081 1083 { 1082 1084 assert(IsAllOk()); 1085 return Tol_StringCaseMatch( String(), pattern.String(), !caseSensitive ); 1086 #if 0 1083 1087 BBool Ok=BFALSE; 1084 1088 if(!HasName() || !pattern.HasName()) { Ok=BFALSE; } … … 1120 1124 } 1121 1125 return(Ok); 1126 #endif 1122 1127 } 1123 1128 … … 1139 1144 BText txt; 1140 1145 BInt len; 1141 if( len=strftime(buf, maxSize, fmt, localtime(&t)))1146 if( (len=strftime(buf, maxSize, fmt, localtime(&t))) ) 1142 1147 { 1143 1148 txt.Copy(buf,len-1); … … 1225 1230 for(n=0; (n<maxItems) && pos && oldPos[0]; n++) 1226 1231 { 1227 if( pos = strchr(oldPos, sep))1232 if( (pos = strchr(oldPos, sep)) ) 1228 1233 { 1229 1234 txt[n].Copy(oldPos, 0, pos-oldPos-1); -
tol/btol/real_type/datgrav.cpp
rbfa6580 r84af815 2115 2115 BInt mode = 0; 2116 2116 if(Arg(3)) { mode = (BInt)Real(Arg(3)); } 2117 if(TolTclIsEnabled()) 2118 { 2119 if ( tclTextMatch || ( tclTextMatch = (BUserFunction*)GraReal()->FindOperator( "TextMatch_Tcl" ) ) ) { 2120 BList *args = Cons( Arg(1), NCons( Arg(2) ) ); 2121 2122 if ( Arg(3) ) { 2123 LstAppend( args, Arg(3) ); 2124 } else { 2125 BUserDat *uMode = BContensDat::New( "", BDat(mode), "" ); 2126 uMode->PutName( "case" ); 2127 LstAppend( args, uMode ); 2128 } 2129 BSyntaxObject *evalResult = tclTextMatch->Evaluator( args ); 2130 if ( evalResult ) { 2131 contens_ = Dat( evalResult ); 2132 } 2133 // DUDA: debo destruir args? 2134 DESTROY( evalResult ); 2135 return; 2136 } 2137 } 2138 Warning("Using internal version of TextMatch could cause invalid results. " 2139 "Please use a TCL version of TOL like tolsh or tolbase."); 2117 2140 2118 contens_ = (BReal)(string.Match(pattern, mode)); 2141 2119 }
Note: See TracChangeset
for help on using the changeset viewer.
