Changeset 518
- Timestamp:
- 06/22/16 16:36:43 (8 years ago)
- Location:
- cpp/frams/genetics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/geno.cpp
r508 r518 35 35 { 36 36 int end; 37 SString newcomment;38 37 switch (genstring.charAt(1)) 39 38 { 40 39 case '/': 41 40 genformat = genstring.charAt(2); 41 if ((genformat=='\0')||(genformat=='\n')) 42 genformat=INVALID_FORMAT; 42 43 if ((end = genstring.indexOf('\n')) >= 0) 43 44 { 44 newcomment = genstring.substr(2, end - 2);45 if (end!=3) genformat=INVALID_FORMAT; 45 46 gencopy = genstring.substr(end + 1); 46 47 mapinshift = end + 1; … … 48 49 else 49 50 { 51 if (genstring.len()!=3) genformat=INVALID_FORMAT; 50 52 gencopy = 0; 51 53 mapinshift = genstring.len(); … … 54 56 case '*': 55 57 genformat = genstring.charAt(2); 58 if ((genformat=='\0')||(genformat=='\n')) 59 genformat=INVALID_FORMAT; 56 60 if ((end = genstring.indexOf("*/")) >= 0) 57 61 { 58 newcomment = genstring.substr(2, end - 2);62 if (end!=3) genformat=INVALID_FORMAT; 59 63 gencopy = genstring.substr(end + 2); 60 64 mapinshift = end + 2; … … 62 66 else 63 67 { 68 if (genstring.len()!=5) genformat=INVALID_FORMAT; 64 69 gencopy = 0; 65 70 mapinshift = genstring.len(); … … 67 72 break; 68 73 } 69 if (newcomment.len() > 0)70 {71 SString token; int pos = 0;72 if (newcomment.getNextToken(pos, token, ';'))73 if (newcomment.getNextToken(pos, token, ';'))74 {75 if (token.len()) txt = token;76 if (newcomment.getNextToken(pos, token, ';'))77 if (token.len()) name = token;78 }79 }80 74 } 81 75 } … … 83 77 gen = gencopy; 84 78 format = genformat; 85 if (!name.len())name = genname;86 if (!txt.len())txt = comment;79 name = genname; 80 txt = comment; 87 81 multiline = (strchr(gen.c_str(), '\n') != 0); 88 82 // mapoutshift...? … … 244 238 if (isvalid >= 0) return; 245 239 if (gen.len() == 0) { isvalid = 0; return; } 240 if (format == INVALID_FORMAT) { isvalid = 0; return; } 246 241 Validators* vals=getValidators(); 247 242 if (vals!=NULL) -
cpp/frams/genetics/geno.h
r494 r518 55 55 56 56 public: 57 static const int INVALID_FORMAT='!'; 57 58 typedef SListTempl<GenoValidator*> Validators; 58 59
Note: See TracChangeset
for help on using the changeset viewer.