- Timestamp:
- 05/23/16 13:50:18 (8 years ago)
- Location:
- cpp/frams
- Files:
-
- 6 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 -
cpp/frams/util/sstringutils.cpp
r382 r512 259 259 } 260 260 261 SString trim( SString& s)261 SString trim(const SString& s) 262 262 { 263 263 const unsigned char*b = (const unsigned char*)s.c_str(); -
cpp/frams/util/sstringutils.h
r382 r512 26 26 void strSetField(SString& txt, const SString& name, const SString& value); 27 27 28 SString trim( SString& s); ///< remove leading/trailing whitespace28 SString trim(const SString& s); ///< remove leading/trailing whitespace 29 29 bool removeCR(SString& s); ///< remove '\r' return true if changed 30 30 bool matchWildcard(const SString& word, const SString& pattern);///< '*' in pattern matches any substring -
cpp/frams/util/validitychecks.cpp
r375 r512 21 21 } 22 22 23 SString stringCheck(SString& in,const char* msgobj,const char* msgfun,const char* msg,SString (*checker)( SString& in))23 SString stringCheck(SString& in,const char* msgobj,const char* msgfun,const char* msg,SString (*checker)(const SString& in)) 24 24 { 25 25 if (!checker) -
cpp/frams/util/validitychecks.h
r375 r512 10 10 11 11 bool listIndexCheck(SList* list,int index,const char* msgobj,const char* msgfun); 12 SString stringCheck(SString& in,const char* msgobj,const char* msgfun,const char* msg,SString (*checker)( SString& in)=NULL);12 SString stringCheck(SString& in,const char* msgobj,const char* msgfun,const char* msg,SString (*checker)(const SString& in)=NULL); 13 13 14 14 #endif
Note: See TracChangeset
for help on using the changeset viewer.