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