示例#1
0
文件: tconfig.cpp 项目: alimon/oscada
bool TCfg::operator==( TCfg &cfg )
{
    if(fld().type() == cfg.fld().type())
	switch(fld().type()) {
	    case TFld::String:	return (getS() == cfg.getS());
	    case TFld::Integer:	return (getI() == cfg.getI());
	    case TFld::Real:	return (getR() == cfg.getR());
	    case TFld::Boolean:	return (getB() == cfg.getB());
	    default: break;
	}
    return false;
}
示例#2
0
文件: dbf_mod.cpp 项目: alimon/oscada
string MTable::getVal( TCfg &cfg, db_str_rec *fld_rec )
{
    string rez;
    switch(cfg.fld().type()) {
	case TFld::Boolean:	rez = cfg.getB() ? "T" : "F";	break;
	case TFld::Integer:	rez = i2s(cfg.getI());		break;
	case TFld::Real: {
	    if(!fld_rec)	{ rez = r2s(cfg.getR()); break; }

	    char str[200];
	    snprintf(str, sizeof(str), "%*.*f", fld_rec->len_fild, fld_rec->dec_field, cfg.getR());
	    rez = str;
	    break;
	}
	default: rez = Mess->codeConvOut(codepage, cfg.getS());	break;
    }

    return rez;
}