Changeset 124 for cpp/frams


Ignore:
Timestamp:
02/10/14 17:09:58 (11 years ago)
Author:
sz
Message:

Param::save altname argument is now more convenient const char*

Location:
cpp/frams
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/multiline_f0_test.cpp

    r121 r124  
    5050
    5151modelparam.select(&m);
    52 modelparam.save(&f,&SString("m"));
     52modelparam.save(&f,"m");
    5353
    5454Part *p;
     
    5959        {
    6060        partparam.select(p);
    61         partparam.save(&f,&SString("p"));
     61        partparam.save(&f,"p");
    6262        }
    6363for (int i=0;j=(Joint*)m.getJoint(i);i++)
     
    6565        jointparam.select(j);
    6666        jointparam.setParamTab(j->usedelta?f0_joint_paramtab:f0_nodeltajoint_paramtab);
    67         jointparam.save(&f,&SString("j"));
     67        jointparam.save(&f,"j");
    6868        }
    6969for (int i=0;n=(Neuro*)m.getNeuro(i);i++)
    7070        {
    7171        neuroparam.select(n);
    72         neuroparam.save(&f,&SString("n"));
     72        neuroparam.save(&f,"n");
    7373        }
    7474for (int a=0;n=(Neuro*)m.getNeuro(a);a++)
     
    8383                nc.info=n->getInputInfo(b);
    8484                connparam.select(&nc);
    85                 connparam.save(&f,&SString("c"));
     85                connparam.save(&f,"c");
    8686                }
    8787        }
  • cpp/frams/param/param.cpp

    r121 r124  
    200200{int i=findId(prop); if (i>=0) return set(i,v); else return PSET_NOPROPERTY;}
    201201
    202 int ParamInterface::save(VirtFILE* f,const SString* altname,bool force)
     202int ParamInterface::save(VirtFILE* f,const char* altname,bool force)
    203203{
    204204const char *p;
     
    206206int err=0,i;
    207207bool withname=false;
    208 if ((!altname)||(altname->len()))
    209         {
    210         err|=(fputs(altname?((const char*)(*altname)):getName(),f)==EOF);
     208if ((altname==NULL)||(altname[0]!=0))
     209        {
     210        err|=(fputs(altname?altname:getName(),f)==EOF);
    211211        err|=(fputs(":\n",f)==EOF);
    212212        withname=true;
  • cpp/frams/param/param.h

    r121 r124  
    152152void quickCopyFrom(ParamInterface *src);
    153153
    154 int save(VirtFILE*,const SString* altname=0,bool force=0);
     154int save(VirtFILE*,const char* altname=NULL,bool force=0);
    155155int saveprop(VirtFILE*,int i,const char* p,bool force=0);
    156156void load(VirtFILE*);
Note: See TracChangeset for help on using the changeset viewer.