Changeset 1310 in Sophya for trunk/SophyaLib/BaseTools/mutyv.cc


Ignore:
Timestamp:
Nov 9, 2000, 4:39:19 PM (25 years ago)
Author:
ansari
Message:

Changement de codage du type ds MuTyV (en prevision d'introduction de
nouveaux types codes ds MuTyV + Modif ObjFIO<DVList> - Reza 9/11/2000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/mutyv.cc

    r1225 r1310  
    3838{
    3939  typ = a.typ;  iv = a.iv;  dv = a.dv;  dv_im = a.dv_im;
    40   if (typ == 'S')  strv = new string(*(a.strv));
     40  if (typ == MTVString)  strv = new string(*(a.strv));
    4141  else strv = NULL;
    4242}
     
    5151MuTyV::MuTyV(char const* s)
    5252{
    53   typ = 'S';
     53  typ = MTVString;
    5454  strv = new string(s);
    5555  mutyv_decodestr(s, dv, dv_im);
     
    6060MuTyV::MuTyV(string const& s)
    6161{
    62   typ = 'S';
     62  typ = MTVString;
    6363  strv = new string(s);
    6464  mutyv_decodestr(s.c_str(), dv, dv_im);
     
    7070{
    7171  typ = a.typ;  iv = a.iv;  dv = a.dv;  dv_im = a.dv_im;
    72   if (typ == 'S')  {
     72  if (typ == MTVString)  {
    7373    if (strv) *strv = *(a.strv); 
    7474    else strv = new string(*(a.strv));
     
    8080char * MuTyV::operator= (char* s)
    8181{
    82   typ = 'S';
     82  typ = MTVString;
    8383  if (strv) *strv = s; 
    8484  else strv = new string(s);
     
    9191string & MuTyV::operator= (string& s)
    9292{
    93   typ = 'S';
     93  typ = MTVString;
    9494  if (strv) *strv = s; 
    9595  else strv = new string(s);
     
    102102MuTyV::operator string() const
    103103{
    104   if (typ == 'S')  return(*strv);
     104  if (typ == MTVString)  return(*strv);
    105105  else {
    106106    char buff[96];
    107     if (typ == 'I')  sprintf(buff,"%ld", (long)iv);
    108     else if (typ == 'D') sprintf(buff,"%.20g", dv);
    109     else if (typ == 'Z') sprintf(buff,"(%.20g , %.20g)", dv, dv_im);
     107    if (typ == MTVInteger)  sprintf(buff,"%ld", (long)iv);
     108    else if (typ == MTVFloat) sprintf(buff,"%.20g", dv);
     109    else if (typ == MTVComplex) sprintf(buff,"(%.20g , %.20g)", dv, dv_im);
    110110    else buff[0] = '\0';
    111111    return(string(buff));
Note: See TracChangeset for help on using the changeset viewer.