16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 14:39:18 +02:00

removed dependencies on the old parser. The code can now be compiled outside of Borland C++

This commit is contained in:
tmj-fstate
2017-01-15 15:04:17 +01:00
parent 7df7c8b76e
commit 15cf3d73a8
87 changed files with 3395 additions and 3232 deletions

View File

@@ -13,21 +13,16 @@ http://mozilla.org/MPL/2.0/.
*/
//#include "system.hpp"
//#include "classes.hpp"
#pragma hdrstop
#include "Driver.h"
#include "mctools.h"
#include "stdafx.h"
#include "MemCell.h"
#include "Globals.h"
#include "Logs.h"
#include "Usefull.h"
#include "Driver.h"
#include "Event.h"
#include "parser.h"
#include "Usefull.h"
#include "Globals.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
//---------------------------------------------------------------------------
TMemCell::TMemCell(vector3 *p)
@@ -148,17 +143,35 @@ bool TMemCell::Compare(char *szTestText, double fTestValue1, double fTestValue2,
{ // porównanie zawartoœci komórki pamiêci z podanymi wartoœciami
if (TestFlag(CheckMask, conditional_memstring))
{ // porównaæ teksty
char *pos = StrPos(szTestText, "*"); // zwraca wskaŸnik na pozycjê albo NULL
if (pos)
{ // porównanie fragmentu ³añcucha
int i = pos - szTestText; // iloœæ porównywanych znaków
if (i) // jeœli nie jest pierwszym znakiem
if (AnsiString(szTestText, i) != AnsiString(szText, i))
return false; // pocz¹tki o d³ugoœci (i) s¹ ró¿ne
/* char *pos = std::strstr(szTestText, "*"); // zwraca wskaŸnik na pozycjê albo NULL
if( nullptr != pos ) { // porównanie fragmentu ³añcucha
int i = pos - szTestText; // iloœæ porównywanych znaków
if( i ) { // jeœli nie jest pierwszym znakiem
if( std::string( szTestText ).substr( 0, i ) != std::string( szText ).substr( 0, i ) ) {
return false; // pocz¹tki o d³ugoœci (i) s¹ ró¿ne
}
}
}
else if (AnsiString(szTestText) != AnsiString(szText))
return false; //³¹ñcuchy s¹ ró¿ne
}
else if( std::string( szTestText ) != std::string( szText ) ) {
return false; //³¹ñcuchy s¹ ró¿ne
}
*/ std::string
source( szText ),
match( szTestText );
auto range = match.find( '*' );
if( range != std::string::npos ) {
// compare string parts
if( 0 != source.compare( 0, range, match, 0, range ) ) {
return false;
}
}
else {
// compare full strings
if( source != match ) {
return false;
}
}
}
// tekst zgodny, porównaæ resztê
return ((!TestFlag(CheckMask, conditional_memval1) || (fValue1 == fTestValue1)) &&
(!TestFlag(CheckMask, conditional_memval2) || (fValue2 == fTestValue2)));