Aggiunto file di configurazione fconv.ini
git-svn-id: svn://10.65.10.50/trunk@291 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ed571ef5d7
commit
d62839f466
@ -5,12 +5,8 @@
|
||||
#include <utility.h>
|
||||
#include <scanner.h>
|
||||
|
||||
// questo sara' il principale, per ora non c'e'
|
||||
#define CONFIG_FILE "prassi.ini"
|
||||
// file parametri studio (uno per studio, per ora e' il principale)
|
||||
#define CONFIG_FILE_STUDIO "prassis.ini"
|
||||
// file parametri ditta (uno per ditta)
|
||||
#define CONFIG_FILE_DITTA "prassid.ini"
|
||||
HIDDEN const char * files[] = {"prassi.ini", "prassis.ini",
|
||||
"prassid.ini", "fconv.ini"};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
@ -129,8 +125,8 @@ TString& TConfig::get(const char* var, const char* section, int index)
|
||||
else
|
||||
{
|
||||
#ifdef DBG
|
||||
error_box("Can't find '%s' in section '%s' of '%s'",
|
||||
var, (const char*)_paragraph, (const char*)_file);
|
||||
// error_box("Can't find '%s' in section '%s' of '%s'",
|
||||
// var, (const char*)_paragraph, (const char*)_file);
|
||||
#endif
|
||||
s = "";
|
||||
}
|
||||
@ -192,7 +188,6 @@ word TConfig::items(const char* var, const char* section)
|
||||
return cnt;
|
||||
}
|
||||
|
||||
|
||||
void TConfig::init(const char *fn, const char* pa)
|
||||
{
|
||||
_file = fn;
|
||||
@ -212,22 +207,19 @@ void TConfig::init(const char *fn, const char* pa)
|
||||
|
||||
|
||||
TConfig::TConfig(int which_config, const char* paragraph)
|
||||
: _file(files[which_config])
|
||||
{
|
||||
if (which_config < CONFIG_STUDIO) _file = CONFIG_FILE;
|
||||
else
|
||||
if (which_config == CONFIG_STUDIO) _file = CONFIG_FILE_STUDIO;
|
||||
else
|
||||
{
|
||||
_file.format("%s/%s", main_app().get_firm_dir(), CONFIG_FILE_DITTA);
|
||||
if (!fexist(_file))
|
||||
fcopy(CONFIG_FILE_DITTA, _file);
|
||||
}
|
||||
|
||||
if (which_config == CONFIG_DITTA)
|
||||
{
|
||||
_file.insert(format("%s/", MainApp()->get_firm_dir()));
|
||||
if (!fexist(_file))
|
||||
fcopy(files[CONFIG_DITTA], _file);
|
||||
}
|
||||
if (!fexist(_file))
|
||||
fatal_box("Impossibile aprire la configurazione %s",
|
||||
which_config < CONFIG_STUDIO ? "generale" :
|
||||
which_config == CONFIG_STUDIO ? "di studio" : "della ditta");
|
||||
|
||||
which_config == CONFIG_GENERAL ? "generale" :
|
||||
which_config == CONFIG_STUDIO ? "di studio" :
|
||||
which_config == CONFIG_DITTA ? "della ditta": "per la conversione archivi");
|
||||
init( _file, paragraph );
|
||||
}
|
||||
|
||||
|
@ -12,11 +12,13 @@
|
||||
class ofstream;
|
||||
|
||||
// questo sara' il principale, per ora non c'e'
|
||||
#define CONFIG_GENERAL -1
|
||||
#define CONFIG_GENERAL 0
|
||||
// file parametri studio (uno per studio, per ora e' il principale)
|
||||
#define CONFIG_STUDIO 0
|
||||
#define CONFIG_STUDIO 1
|
||||
// file parametri ditta (uno per ditta)
|
||||
#define CONFIG_DITTA 1
|
||||
#define CONFIG_DITTA 2
|
||||
// file conversioni archivi
|
||||
#define CONFIG_FCONV 3
|
||||
|
||||
|
||||
class TConfig : public TObject
|
||||
|
Loading…
x
Reference in New Issue
Block a user