Patch level : 2.1 nopatch

Files correlati     : agalib.lib
Ricompilazione Demo : [ ]
Commento            :

csort.*       Tolte tutte dipendenze dalle librerie e sostituite con chiamate a xvt
currency.cpp  Tolti vecchi riferimenti a LIT e sostituiti con _firm_val
maskfld.h     Indentazioni e commenti
varrec.*      Indentazioni e commenti
xml.*         Aggiunta gestione attributi booleani (oltre alle stringhe)


git-svn-id: svn://10.65.10.50/trunk@11807 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2004-03-05 08:50:18 +00:00
parent 25a91f6837
commit e78b03e4da
8 changed files with 57 additions and 53 deletions

View File

@ -1,4 +1,5 @@
#include <checks.h> #include "xvt.h"
#include <cfiles.h> #include <cfiles.h>
#include <csort.h> #include <csort.h>
@ -59,8 +60,8 @@ void dummy(void);
@(FD) @(FD)
*/ */
int init_sort(prms) /* struttura di descrizione del sort */
struct s_prm *prms; /* struttura di descrizione del sort */ int init_sort(struct s_prm *prms)
{ {
sp = prms; sp = prms;
if ((bf = appr_mem(&bspace)) != NULL) { if ((bf = appr_mem(&bspace)) != NULL) {
@ -394,7 +395,7 @@ static FILE *wopen(char* name) /* nome del file temporaneo */
fp = fopen(name, "wb+"); fp = fopen(name, "wb+");
if (fp == NULL) if (fp == NULL)
fatal_box("Can't open SORT file"); xvt_dm_post_fatal_exit("Can't open SORT file");
return fp; return fp;
} }
@ -541,7 +542,8 @@ static FILE *wopen(char* name) /* nome del file temporaneo */
void sort_stats() void sort_stats()
{ {
message_box( char msg[256];
sprintf(msg,
"Record length = %d\n" "Record length = %d\n"
"%u records sorted\n" "%u records sorted\n"
"%u sequences\n" "%u sequences\n"
@ -549,6 +551,7 @@ static FILE *wopen(char* name) /* nome del file temporaneo */
"%u records per buffer", "%u records per buffer",
sp->rc_len, totrcd, no_seq, bspace, nrcds sp->rc_len, totrcd, no_seq, bspace, nrcds
); );
xvt_dm_post_note(msg);
} }
/* /*

View File

@ -1,7 +1,11 @@
#include <currency.h> #include <currency.h>
#include <diction.h>
#include <prefix.h> #include <prefix.h>
#include <recarray.h> #include <recarray.h>
#include <xvt.h>
#include <statbar.h>
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// DowJones // DowJones
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -68,15 +72,21 @@ TObject* TDowJones::rec2obj(const TRectype& rec) const
{ {
TExchangeData* data = new TExchangeData; TExchangeData* data = new TExchangeData;
const TString16 codval = rec.get("CODTAB"); const TString4 codval = rec.get("CODTAB");
data->_chg = rec.get_real("S4"); data->_chg = rec.get_real("S4");
if (data->_chg <= ZERO) if (data->_chg <= ZERO)
{ {
data->_chg = rec.get_real("R10"); data->_chg = rec.get_real("R10");
if (data->_chg <= ZERO) if (data->_chg <= ZERO)
{ {
if (codval.not_empty() && codval != "LIT") #ifdef DBG
NFCHECK("Codice valuta senza cambio: '%s'", (const char*)codval); if (codval.not_empty() && codval != _firm_val)
{
TString msg = TR("Codice valuta senza cambio");
msg << ": " << codval;
statbar_set_title(TASK_WIN, msg);
}
#endif
data->_chg = 1.0; data->_chg = 1.0;
} }
} }

View File

@ -1599,12 +1599,12 @@ class TTree;
class TTree_field : public TWindowed_field class TTree_field : public TWindowed_field
{ {
protected: // TObject protected: // TObject
word class_id() const; virtual word class_id() const;
bool is_kind_of(word cid) const; virtual bool is_kind_of(word cid) const;
protected: // TWindowed_field protected: // TWindowed_field
virtual TField_window* create_window(int x, int y, int dx, int dy, virtual TField_window* create_window(int x, int y, int dx, int dy, WINDOW parent);
WINDOW parent);
public: public:
TTree* tree() const; TTree* tree() const;
void set_tree(TTree* t); void set_tree(TTree* t);
@ -1617,7 +1617,6 @@ public:
void set_header(const char* head); void set_header(const char* head);
void set_row_height(int rh); void set_row_height(int rh);
TTree_field(TMask* m) : TWindowed_field(m) { } TTree_field(TMask* m) : TWindowed_field(m) { }
virtual ~TTree_field() { } virtual ~TTree_field() { }
}; };
@ -1627,8 +1626,8 @@ class TGolem_client_field : public TWindowed_field
TGolem_field* _driver; TGolem_field* _driver;
protected: // TObject protected: // TObject
word class_id() const; virtual word class_id() const;
bool is_kind_of(word cid) const; virtual bool is_kind_of(word cid) const;
protected: // TWindowed_field protected: // TWindowed_field
virtual TField_window* create_window(int x, int y, int dx, int dy, WINDOW parent); virtual TField_window* create_window(int x, int y, int dx, int dy, WINDOW parent);

View File

@ -1,19 +1,11 @@
#include <relation.h> #include <relation.h>
#include <varrec.h> #include <varrec.h>
// HIDDEN bool rec_has_memo(const RecDes* rd)
//{
// for( int i = rd->NFields - 1; i >= 0; i--)
// if (rd->Fd[i].TypeF == _memofld)
// return TRUE;
// return FALSE;
//}
TVariable_field::TVariable_field( TVariable_field::TVariable_field(
const char * name, // const char * name,
const char * expr, // const char * expr,
TTypeexp type, TTypeexp type,
int len) // int len)
: _rec(NULL), _name(name), _e(NULL) , _getfunc(NULL), : _rec(NULL), _name(name), _e(NULL) , _getfunc(NULL),
_put_string(NULL), _in_get(FALSE),_lenght(len) _put_string(NULL), _in_get(FALSE),_lenght(len)
{ {

View File

@ -24,11 +24,11 @@ typedef const char * (*VIRTUAL_GET_FUNCTION)(TVariable_rectype & r);
// @base public | TObject // @base public | TObject
class TVariable_field : public TObject class TVariable_field : public TObject
// @author:(INTERNAL) Sandro // @author:(INTERNAL) Alessandro
{ {
TVariable_rectype * _rec; TVariable_rectype * _rec;
TString _name; TString80 _name;
TExpression * _e; TExpression * _e;
TString _value; TString _value;
TToken_string * _put_string; TToken_string * _put_string;

View File

@ -106,23 +106,9 @@ public:
void TXmlAttr::Write(ostream& outf) const void TXmlAttr::Write(ostream& outf) const
{ {
if (empty())
{
outf << '"' << '"';
}
else
{
if (real::is_real(*this))
{
print_on(outf);
}
else
{
outf << '"'; outf << '"';
print_on(outf); print_on(outf);
outf << '"'; outf << '"';
}
}
} }
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -134,6 +120,7 @@ TXmlItem& TXmlItem::SetAttr(const char* strAttr, const char* strVal)
if (m_Attributes == NULL) if (m_Attributes == NULL)
m_Attributes = new TAssoc_array; m_Attributes = new TAssoc_array;
m_Attributes->remove(strAttr); m_Attributes->remove(strAttr);
if (strVal && *strVal)
m_Attributes->add(strAttr, new TXmlAttr(strVal)); m_Attributes->add(strAttr, new TXmlAttr(strVal));
return *this; return *this;
} }
@ -149,6 +136,16 @@ const TString& TXmlItem::GetAttr(const char* strAttr) const
return EMPTY_STRING; return EMPTY_STRING;
} }
TXmlItem& TXmlItem::SetAttr(const char* strAttr, bool b)
{
return SetAttr(strAttr, b ? "1" : "");
}
bool TXmlItem::GetBoolAttr(const char* strAttr) const
{
return !GetAttr(strAttr).blank();
}
int TXmlItem::GetChildren() const int TXmlItem::GetChildren() const
{ {
int n = 0; int n = 0;

View File

@ -48,6 +48,9 @@ public:
TXmlItem& SetAttr(const char* strAttr, const char* strVal); TXmlItem& SetAttr(const char* strAttr, const char* strVal);
const TString& GetAttr(const char* strAttr) const; const TString& GetAttr(const char* strAttr) const;
TXmlItem& SetAttr(const char* strAttr, bool yes);
bool GetBoolAttr(const char* strAttr) const;
TXmlItem& AddChild(const char* strTag); TXmlItem& AddChild(const char* strTag);
TXmlItem& AddSoapString(const char* name, const char* value, bool typized = false); TXmlItem& AddSoapString(const char* name, const char* value, bool typized = false);
TXmlItem& AddSoapInt(const char* name, int value, bool typized = false); TXmlItem& AddSoapInt(const char* name, int value, bool typized = false);