#ifndef __PREFIX_H
#define __PREFIX_H

#ifndef __EXTCTYPE_H
#include <extctype.h>
#endif

#ifndef __FILES_H
#include <files.h>
#endif

#ifndef __STRINGS_H
#include <strings.h>
#endif

// @C
// class TPrefix : public TObject
// @END

class TPrefix : public TObject
{
  // @DPRIV
  TString _prefix;
  int*          _dirfl;
  int*          _recfl;
  long _filelevel;
  SecDef* _fdir;
  SecDef* _rdir;
  
  bool test(const char* s) const ;
  void put();

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);
  const char* name() const { return _prefix;}
  long filelevel() const {return _filelevel;} 
  
  TPrefix();
  virtual ~TPrefix();
};


const char* firm2dir(long codditta);

#ifdef __PREFIX_CPP
#define extern
#endif

// @DPUB
extern TPrefix* prefhndl
// @END
#ifdef __PREFIX_CPP
= NULL ;
#undef extern
#else
;
#endif

#endif // __PREFIX_H

