Modificaciones para conservar tamaño en ascii de los campos numéricos
parent
5acf5e3f28
commit
8000b28924
|
|
@ -92,6 +92,7 @@ bool GdataTable::addColm(char* name, int type, int size)
|
|||
colmName.add(name);
|
||||
GdataTableColum inf;
|
||||
void* c = NULL;
|
||||
inf.szascii = size;
|
||||
inf.flags=0;
|
||||
inf.nb=size;
|
||||
inf.type=type;
|
||||
|
|
@ -142,6 +143,8 @@ bool GdataTable::addColm(char* name, int type, int size)
|
|||
case(Tstring):
|
||||
case(Tbin):
|
||||
c = new Cgarray<char>();
|
||||
if (!inf.nb)
|
||||
inf.nb = 32;
|
||||
if(nn>0)
|
||||
{
|
||||
if(!((*(Cgarray<char>*)c)+=(nn*inf.nb)))
|
||||
|
|
@ -438,21 +441,23 @@ bool GdataTable::addMemRow( int nrow )
|
|||
//***************************************************************************
|
||||
int GdataTable::getSizeASCII( int icol )
|
||||
{
|
||||
if(!colm[icol].nb)
|
||||
if (colm[icol].szascii)
|
||||
return colm[icol].szascii;
|
||||
else if(!colm[icol].nb)
|
||||
{
|
||||
switch(colm[icol].type)
|
||||
{
|
||||
case(Tbool):
|
||||
return 1;
|
||||
case(Tint):
|
||||
return 4;
|
||||
return 16;
|
||||
case(Tdouble):
|
||||
return 8;
|
||||
return 16;
|
||||
case(Tint64):
|
||||
return 8;
|
||||
return 32;
|
||||
case(Tbin):
|
||||
case(Tstring):
|
||||
return colm[icol].nb;
|
||||
return 32;// colm[icol].nb;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -460,4 +465,5 @@ int GdataTable::getSizeASCII( int icol )
|
|||
else
|
||||
return colm[icol].nb;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
|
|
@ -12,6 +12,7 @@ public:
|
|||
int type;//tipo de dato
|
||||
int nb;//numero de bytes de informacion
|
||||
int flags;
|
||||
int szascii; //el tamaño en ascii que trae el dbf
|
||||
};
|
||||
|
||||
class UTILES_EXPORT GdataTable
|
||||
|
|
|
|||
Loading…
Reference in New Issue