- Timestamp:
- 07/12/15 00:47:33 (9 years ago)
- Location:
- cpp/frams/param
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/param/multiparamload.cpp
r375 r413 94 94 SString buf; 95 95 if (status==OnError) return status; 96 int unexpected_line = 0; 96 97 while (!finished()) 97 98 { … … 103 104 if ((status!=Finished) && maybeBreak(AfterObject)) 104 105 break; 106 unexpected_line = 0; 105 107 continue; 106 108 } … … 113 115 if (!loadSStringLine(file,buf)) 114 116 { 117 unexpected_line = 0; 115 118 if (!returnFromIncluded()) 116 119 { … … 124 127 if (buf[0]=='#') 125 128 { 129 unexpected_line = 0; 126 130 if (buf.startsWith("#include")) 127 131 { … … 150 154 } 151 155 buf=trim(buf); 152 if ((buf.len()>1)&&(buf[buf.len()-1]==':')) 153 { 156 if (buf.len()==0) 157 unexpected_line = 0; 158 else if ((buf.len()>1)&&(buf[buf.len()-1]==':')) 159 { 160 unexpected_line = 0; 154 161 lastunknown=0; 155 162 lastunknown=buf.substr(0,buf.len()-1); … … 170 177 } 171 178 179 } 180 else 181 { 182 switch(unexpected_line) 183 { 184 case 0: 185 { 186 const char* thisfilename=file->VgetPath(); 187 logPrintf("MultiParamLoader","go", LOG_WARN, "Ignored unexpected line %d%s", 188 linenum, 189 thisfilename ? SString::sprintf(" while reading '%s'",thisfilename).c_str():""); 190 } 191 break; 192 193 case 1: 194 logPrintf("MultiParamLoader","go", LOG_WARN, "The following line(s) were also unexpected and were ignored"); 195 break; 196 } 197 unexpected_line++; 172 198 } 173 199 } -
cpp/frams/param/param.cpp
r412 r413 400 400 bool loaded; 401 401 int fields_loaded = 0; 402 int unexpected_line = 0; 402 403 if ((i=findId("beforeLoad"))>=0) 403 404 call(i,NULL,NULL); … … 406 407 if (linenum) (*linenum)++; 407 408 const char* t = buf.c_str(); 408 p0 = t; while ( (*p0 == ' ') || (*p0 == '\t')) p0++;409 p0 = t; while (isblank(*p0)) p0++; 409 410 if (!*p0) break; 410 if (p0[0] == '#') continue; 411 p = strchr(p0, ':'); if (!p) continue; 411 if (p0[0] == '#') { unexpected_line = 0; continue; } 412 p = strchr(p0, ':'); 413 if (!p) 414 { 415 switch(unexpected_line) 416 { 417 case 0: 418 logPrintf("ParamInterface", "load", LOG_WARN, "Ignored unexpected line %s while reading object '%s'", 419 linenum ? 420 SString::sprintf("%d",*linenum).c_str() 421 : SString::sprintf("'%s'", p0).c_str(), 422 getName()); 423 break; 424 case 1: 425 logPrintf("ParamInterface", "load", LOG_WARN, "The following line(s) were also unexpected and were ignored"); 426 break; 427 } 428 unexpected_line++; 429 continue; 430 } 431 unexpected_line = 0; 412 432 p_len = (int)(p - p0); 413 433 loaded = false;
Note: See TracChangeset
for help on using the changeset viewer.