Patch level : 12.0 no-patch

Files correlati     :
Commento            :

Aggiunto metodo per aggiungere un booleano a una token_string
Aggiunta safe_delete come funzione da usare al posto dell macro SAFE_DELETE che sarà eliminata
This commit is contained in:
Alessandro Bonazzi 2020-05-19 19:32:56 +02:00
parent 9807fb083c
commit 3d4a5a7807
2 changed files with 9 additions and 3 deletions

View File

@ -656,6 +656,8 @@ public:
void add(const real r, int pos = -1); void add(const real r, int pos = -1);
// @cmember Aggiunge un reale // @cmember Aggiunge un reale
void add(const TDate d, int pos = -1); void add(const TDate d, int pos = -1);
// @cmember Aggiunge un booleano
void add(bool on, int pos = -1) { add(on ? "X" : ""); }
// @cmember Inserisce una stringa // @cmember Inserisce una stringa
void insert_at(const char* s, int n); void insert_at(const char* s, int n);
// @cmember Toglie la stringa di posizione pos // @cmember Toglie la stringa di posizione pos

View File

@ -16,7 +16,7 @@
#include <lffiles.h> #include <lffiles.h>
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define SAFE_DELETE(p) { if( (p) != nullptr ) delete (p); (p) = nullptr; } #define SAFE_DELETE(p) safe_delete(p)
#define TOSTRING(x) STRINGIFY(x) #define TOSTRING(x) STRINGIFY(x)
#define DEBUG_ENABLED is_debug_station() #define DEBUG_ENABLED is_debug_station()
@ -24,6 +24,10 @@ bool sirio_codesigning(const TFilename& filename, bool verify = false);
#define SIRIOSIGN(filename) sirio_codesigning((const TFilename&)((filename)), false) #define SIRIOSIGN(filename) sirio_codesigning((const TFilename&)((filename)), false)
#define SIRIOSIGN_VERIFY(filename) sirio_codesigning((const TFilename&)((filename)), true) #define SIRIOSIGN_VERIFY(filename) sirio_codesigning((const TFilename&)((filename)), true)
template<typename T> void safe_delete(T*& a) {
delete a;
a = nullptr;
}
class TPerformance_profiler : public TObject class TPerformance_profiler : public TObject
{ {