Changeset 512 for cpp/frams/model
- Timestamp:
- 05/23/16 13:50:18 (9 years ago)
- Location:
- cpp/frams/model
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/model/autoname.cpp
r348 r512 11 11 SString t; 12 12 t = firstName(model); 13 t += ' '; 14 t += lastName(model); 13 SString last=lastName(model); 14 if (last.len()>0) 15 { 16 t += ' '; 17 t += last; 18 } 15 19 return t; 16 20 } … … 33 37 } 34 38 35 SString AutoName::firstName( Model& model)39 SString AutoName::firstName(const SString& g) 36 40 { 37 41 char buf[8]; 38 42 unsigned int s1 = 0, s2 = 0, s3 = 0; 39 SString g = model.getGeno().getGene();40 43 const char *x = g.c_str(); 44 if (*x==0) return SString(); 41 45 for (; *x; x++) { s1 += *x; s2 = s2**x + *x; s3 = (s3^*x) + *x; } 42 46 char* t = buf; … … 46 50 buf[0] = (char)toupper(buf[0]); 47 51 return SString(buf); 52 } 53 54 SString AutoName::firstName(Model& model) 55 { 56 return firstName(model.getGeno().getGene()); 48 57 } 49 58 -
cpp/frams/model/autoname.h
r343 r512 11 11 class AutoName 12 12 { 13 public: 14 static SString makeName(Model&); 15 static SString firstName(const SString& g); 13 16 static SString firstName(Model&); 14 17 static SString lastName(Model&); 15 public:16 static SString makeName(Model&);17 18 }; 18 19
Note: See TracChangeset
for help on using the changeset viewer.