Aggiunta la add con puntatore a TTracciato_record
git-svn-id: svn://10.65.10.50/trunk@5288 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
027467de50
commit
eb223fa499
@ -38,7 +38,7 @@ TObject* TTracciato_record::dup() const
|
|||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
TTracciato_record::TTracciato_record(const TTracciato_record& tr)
|
TTracciato_record::TTracciato_record(const TTracciato_record& tr)
|
||||||
{
|
{
|
||||||
set_type(tr.type());
|
set_type(tr.type());
|
||||||
_tracciati_campo = tr._tracciati_campo;
|
_tracciati_campo = tr._tracciati_campo;
|
||||||
@ -49,6 +49,11 @@ void TTracciato_record::add(const TTracciato_campo& tc, int pos)
|
|||||||
_tracciati_campo.add(tc,pos);
|
_tracciati_campo.add(tc,pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TTracciato_record::add(TTracciato_campo* tc, int pos)
|
||||||
|
{
|
||||||
|
_tracciati_campo.add(tc,pos);
|
||||||
|
}
|
||||||
|
|
||||||
int TTracciato_record::get_pos(const char* name) const
|
int TTracciato_record::get_pos(const char* name) const
|
||||||
{
|
{
|
||||||
for (int i = _tracciati_campo.last(); i >= 0; i = _tracciati_campo.pred(i))
|
for (int i = _tracciati_campo.last(); i >= 0; i = _tracciati_campo.pred(i))
|
||||||
@ -65,7 +70,7 @@ TTracciato_campo& TTracciato_record::get(int n)
|
|||||||
if (TTracciato_record::ptr(n) == NULL)//se non esiste lo creo
|
if (TTracciato_record::ptr(n) == NULL)//se non esiste lo creo
|
||||||
{
|
{
|
||||||
TTracciato_campo* t = new TTracciato_campo();
|
TTracciato_campo* t = new TTracciato_campo();
|
||||||
TTracciato_record::add(*t, n);
|
add(t, n);
|
||||||
}
|
}
|
||||||
return (TTracciato_campo&)_tracciati_campo[n];
|
return (TTracciato_campo&)_tracciati_campo[n];
|
||||||
}
|
}
|
||||||
@ -110,7 +115,10 @@ void TFile_text::set_type_parm(TConfig& config, TString& section)
|
|||||||
tipo.set_decimal(config.get_int("DECIMAL", section));
|
tipo.set_decimal(config.get_int("DECIMAL", section));
|
||||||
tipo.set_align(config.get_char("ALIGN", section));
|
tipo.set_align(config.get_char("ALIGN", section));
|
||||||
TString s = config.get("FILLER", section);
|
TString s = config.get("FILLER", section);
|
||||||
tipo.set_filler(s[1]);
|
if (s.len() > 1)
|
||||||
|
tipo.set_filler(s[1]);
|
||||||
|
else
|
||||||
|
tipo.set_filler(s[0]);
|
||||||
tipo.set_picture(config.get("PICTURE", section));
|
tipo.set_picture(config.get("PICTURE", section));
|
||||||
_tipi.add(lavoro, tipo);// aggiungo il tracciato campo all'assoc_array dei tipi predefiniti
|
_tipi.add(lavoro, tipo);// aggiungo il tracciato campo all'assoc_array dei tipi predefiniti
|
||||||
}
|
}
|
||||||
@ -143,7 +151,7 @@ void TFile_text::set_rec_parm(TConfig& config, const char* section)
|
|||||||
if (!tipo.empty())
|
if (!tipo.empty())
|
||||||
{
|
{
|
||||||
TTracciato_campo& tc = (TTracciato_campo&)_tipi[tipo];
|
TTracciato_campo& tc = (TTracciato_campo&)_tipi[tipo];
|
||||||
tr.add(tc, n);
|
tr.add(tc, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
indici.set(n);
|
indici.set(n);
|
||||||
@ -189,7 +197,7 @@ void TFile_text::set_rec_parm(TConfig& config, const char* section)
|
|||||||
{
|
{
|
||||||
bool condition = tc.align() != obj[0];
|
bool condition = tc.align() != obj[0];
|
||||||
if (condition)
|
if (condition)
|
||||||
tc.set_align(obj[0]);
|
tc.set_align(obj[0]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (lavoro == "FIL")
|
if (lavoro == "FIL")
|
||||||
|
@ -77,6 +77,7 @@ public:
|
|||||||
const TString& type() const {return _type;}
|
const TString& type() const {return _type;}
|
||||||
void set_type(const TString& type) {_type = type;}
|
void set_type(const TString& type) {_type = type;}
|
||||||
void add(const TTracciato_campo& tc, int pos = -1);//aggiunge tracciato campo all'array
|
void add(const TTracciato_campo& tc, int pos = -1);//aggiunge tracciato campo all'array
|
||||||
|
void add(TTracciato_campo* tc, int pos = -1);//aggiunge tracciato campo all'array
|
||||||
TTracciato_campo& get(int n);//ritorna il tracciato campo n dell'array (se non c'e' lo crea)
|
TTracciato_campo& get(int n);//ritorna il tracciato campo n dell'array (se non c'e' lo crea)
|
||||||
//ritorna il tracciato campo n dell'array
|
//ritorna il tracciato campo n dell'array
|
||||||
const TTracciato_campo& get(int n) const {return (TTracciato_campo&)_tracciati_campo[n];}
|
const TTracciato_campo& get(int n) const {return (TTracciato_campo&)_tracciati_campo[n];}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user