Changeset 637 for trunk/thirds


Ignore:
Timestamp:
Apr 24, 2015, 11:47:50 PM (10 years ago)
Author:
djay
Message:

Fixes in zcfg generator and fixes to build correctly on GNU/Linux.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/thirds/saga2zcfg/saga2zcfg.c

    r634 r637  
    1717const char* cleanAbstract(CSG_String abstract){
    1818  char* tmp=strdup(abstract.b_str());
    19   CSG_String val=CSG_String("")+tmp;
     19  CSG_String val=CSG_String(" ")+tmp;
    2020  if(val.Contains("¸")){
    2121    val.Replace("¸"," ");
     
    2323  if(val.Contains("\n")){
    2424    val.Replace("\n","<br/>");
     25  }
     26  if(val.Contains("\r")){
     27    val.Replace("\r","");
    2528  }
    2629  if(val.Contains("<")){
     
    4245    fprintf(stdout,"  Abstract = %s\n",CSG_String(param->Get_Name()).b_str());
    4346  else{
    44     fprintf(stdout,"  Abstract = %s\n",cleanAbstract(CSG_String(param->Get_Description()).BeforeFirst('\n')));
     47    fprintf(stdout,"  Abstract = %s\n",cleanAbstract(CSG_String(param->Get_Description())));
    4548  }
    4649  if(!out){
     
    145148
    146149          mkdir(library->Get_Library_Name().b_str(),0755);
     150          fprintf(stderr,"%s %s \n",library->Get_Library_Name().b_str(),CSG_String(module->Get_ID()).b_str());
    147151          FILE *stdout1=fopen((library->Get_Library_Name()+"/"+module->Get_ID()+".zcfg").b_str(),"w+");
    148152          fprintf(stdout1,"[%d]\n",j);
    149153          fprintf(stdout1," Title = %s\n",module->Get_Name().b_str());
    150           if(CSG_String(module->Get_Description()).is_Empty())
     154          if(CSG_String(module->Get_Description()).is_Empty() ||
     155             module->Get_Description().Length()<module->Get_Name().Length() )
    151156            fprintf(stdout1," Abstract = %s\n",module->Get_Name().b_str());
    152           else
    153             fprintf(stdout1," Abstract = %s\n",cleanAbstract(module->Get_Description()));
     157          else{
     158            const char *tmp=cleanAbstract(module->Get_Description());
     159            if(tmp==NULL || strlen(tmp)<7 ){
     160              fprintf(stdout1," Abstract = %s\n",module->Get_Name().b_str());
     161            }
     162            else{
     163              fprintf(stdout1," Abstract = %s\n",tmp);
     164            }
     165          }
    154166          fprintf(stdout1," storeSupported = true\n");
    155167          fprintf(stdout1," statusSupported = true\n");
     
    294306                    for(int l=0;l<clen;l++){
    295307                      //fprintf(stdout1,"%d",l);
    296                       fprintf(stdout1,"%s",cleanAbstract(CSG_String(choice->Get_Item(l))));
     308                      fprintf(stdout1,"%s",(CSG_String(choice->Get_Item(l))).b_str());
    297309                      if(l+1<clen)
    298310                        fprintf(stdout1,",");
     
    302314                  fprintf(stdout1,"   <Default>\n");
    303315                  if( !param->Get_Data()->Get_Default().is_Empty() ){
    304                     fprintf(stdout1,"    value = %s\n",cleanAbstract(CSG_String(choice->Get_Item(atoi(param->Get_Data()->Get_Default())))));
     316                    fprintf(stdout1,"    value = %s\n",CSG_String(choice->Get_Item(atoi(param->Get_Data()->Get_Default()))).b_str());
    305317                  }
    306318                  fprintf(stdout1,"   </Default>\n");
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png