From 4bd1136081d072b57867277ba9880c8f4ad63221 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 10 Nov 1994 11:22:47 +0000 Subject: [PATCH] Aggiunto metodo exist git-svn-id: svn://10.65.10.50/trunk@581 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/prefix.cpp | 13 +++++++++++++ include/prefix.h | 1 + 2 files changed, 14 insertions(+) diff --git a/include/prefix.cpp b/include/prefix.cpp index d24e3ec66..7e4b117b7 100755 --- a/include/prefix.cpp +++ b/include/prefix.cpp @@ -171,6 +171,19 @@ void TPrefix::set(const char* name, bool force, TFilelock mode) } } +bool TPrefix::exist(long codditta) const +{ + CHECKD(codditta > 0, "Solo le ditte con codice maggiore di zero possono esistere : codice", codditta); + TFilename s(firm2dir(codditta)); s << "/dir.gen"; + + if (fexist(s)) + { + s = s.path(); + s << "/trc.gen"; + return fexist(s); + } + return FALSE; +} bool TPrefix::test(const char* s) const { diff --git a/include/prefix.h b/include/prefix.h index e88d8bbd4..72615cc67 100755 --- a/include/prefix.h +++ b/include/prefix.h @@ -33,6 +33,7 @@ class TPrefix : public TObject public: // @FPUB void set(const char* name = NULL, bool force = FALSE, TFilelock mode = _manulock); + bool exist(long codditta) const; bool test(long codditta) const; long get_codditta() const ; bool set_codditta(long codditta, bool force = FALSE);