Inserita la lunghezza del campo nei costruttori di TVariable_field
git-svn-id: svn://10.65.10.50/trunk@4496 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
fb0c044fcd
commit
7e4bf2b28b
@ -7,10 +7,11 @@
|
||||
TVariable_field::TVariable_field(
|
||||
const char * name, //
|
||||
const char * expr, //
|
||||
TTypeexp type) //
|
||||
TTypeexp type,
|
||||
int len) //
|
||||
: _rec(NULL), _name(name), _e(NULL) , _getfunc(NULL),
|
||||
_put_string(NULL), _destroy_expression(TRUE),
|
||||
_in_get(FALSE)
|
||||
_in_get(FALSE),_lenght(len)
|
||||
{
|
||||
if (expr && *expr)
|
||||
{
|
||||
@ -21,10 +22,11 @@ TVariable_field::TVariable_field(
|
||||
|
||||
TVariable_field::TVariable_field(
|
||||
const char * name, //
|
||||
VIRTUAL_GET_FUNCTION getfunc) //
|
||||
VIRTUAL_GET_FUNCTION getfunc,
|
||||
int len) //
|
||||
: _name(name), _e(NULL) , _rec(NULL), _getfunc(getfunc),
|
||||
_put_string(NULL), _destroy_expression(FALSE),
|
||||
_in_get(FALSE)
|
||||
_in_get(FALSE),_lenght(len)
|
||||
{
|
||||
CHECK(_getfunc, "You must pass a valid VIRTUAL_GET_FUNCTION");
|
||||
}
|
||||
@ -32,17 +34,18 @@ TVariable_field::TVariable_field(
|
||||
TVariable_field::TVariable_field(
|
||||
const char * name, //
|
||||
TExpression * expr, //
|
||||
TTypeexp type) //
|
||||
TTypeexp type,
|
||||
int len) //
|
||||
: _rec(NULL), _name(name), _e(expr) , _getfunc(NULL),
|
||||
_put_string(NULL), _destroy_expression(FALSE),
|
||||
_in_get(FALSE)
|
||||
_in_get(FALSE),_lenght(len)
|
||||
{
|
||||
}
|
||||
|
||||
TVariable_field::TVariable_field(const TVariable_field & f)
|
||||
: _rec(f._rec), _name(f._name), _e(NULL) , _getfunc(f._getfunc),
|
||||
_put_string(NULL), _destroy_expression(f._destroy_expression),
|
||||
_in_get(FALSE)
|
||||
_in_get(FALSE),_lenght(f._lenght)
|
||||
{
|
||||
if (f._e)
|
||||
_e = (TExpression *) f._e->dup();
|
||||
@ -238,7 +241,7 @@ int TVariable_rectype::length(const char* fieldname) const
|
||||
|
||||
{
|
||||
if (_virtual_fields.objptr(fieldname))
|
||||
return 255;
|
||||
return ((TVariable_field *)_virtual_fields.objptr(fieldname))->lenght();
|
||||
return TRectype::length(fieldname);
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@ class TVariable_field : public TObject
|
||||
VIRTUAL_GET_FUNCTION _getfunc;
|
||||
bool _destroy_expression;
|
||||
bool _in_get;
|
||||
int _lenght;
|
||||
|
||||
public:
|
||||
// @access Public Member
|
||||
@ -63,13 +64,16 @@ public:
|
||||
// @cmember il campo non ha formule o funzioni collegate
|
||||
bool plain() const
|
||||
{ return _e == NULL && _getfunc == NULL;}
|
||||
// @cmember Ritorna la lunghezza del campo
|
||||
int lenght() const
|
||||
{return _lenght;}
|
||||
|
||||
// @ cmember Costruttore con una espressione di calcolo
|
||||
TVariable_field(const char * name, const char * expr = "", TTypeexp type = _strexpr);
|
||||
TVariable_field(const char * name, const char * expr = "", TTypeexp type = _strexpr, int len=255);
|
||||
// @ cmember Costruttore con una funzione
|
||||
TVariable_field(const char * name, VIRTUAL_GET_FUNCTION getfunc);
|
||||
TVariable_field(const char * name, VIRTUAL_GET_FUNCTION getfunc, int len=255);
|
||||
// @ cmember Costruttore con una espressione di calcolo
|
||||
TVariable_field(const char * name, TExpression * expr, TTypeexp type = _strexpr);
|
||||
TVariable_field(const char * name, TExpression * expr, TTypeexp type = _strexpr, int len=255);
|
||||
// @ cmember Costruttore con un variable_field
|
||||
TVariable_field(const TVariable_field & f);
|
||||
// @ cmember Distruttore
|
||||
|
Loading…
x
Reference in New Issue
Block a user