Changeset 637 for trunk/thirds
- Timestamp:
- Apr 24, 2015, 11:47:50 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/thirds/saga2zcfg/saga2zcfg.c
r634 r637 17 17 const char* cleanAbstract(CSG_String abstract){ 18 18 char* tmp=strdup(abstract.b_str()); 19 CSG_String val=CSG_String(" ")+tmp;19 CSG_String val=CSG_String(" ")+tmp; 20 20 if(val.Contains("¸")){ 21 21 val.Replace("¸"," "); … … 23 23 if(val.Contains("\n")){ 24 24 val.Replace("\n","<br/>"); 25 } 26 if(val.Contains("\r")){ 27 val.Replace("\r",""); 25 28 } 26 29 if(val.Contains("<")){ … … 42 45 fprintf(stdout," Abstract = %s\n",CSG_String(param->Get_Name()).b_str()); 43 46 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()))); 45 48 } 46 49 if(!out){ … … 145 148 146 149 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()); 147 151 FILE *stdout1=fopen((library->Get_Library_Name()+"/"+module->Get_ID()+".zcfg").b_str(),"w+"); 148 152 fprintf(stdout1,"[%d]\n",j); 149 153 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() ) 151 156 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 } 154 166 fprintf(stdout1," storeSupported = true\n"); 155 167 fprintf(stdout1," statusSupported = true\n"); … … 294 306 for(int l=0;l<clen;l++){ 295 307 //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()); 297 309 if(l+1<clen) 298 310 fprintf(stdout1,","); … … 302 314 fprintf(stdout1," <Default>\n"); 303 315 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()); 305 317 } 306 318 fprintf(stdout1," </Default>\n");
Note: See TracChangeset
for help on using the changeset viewer.