Changeset 467
- Timestamp:
- 02/07/16 23:21:55 (9 years ago)
- Location:
- cpp/frams/genetics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/genman.cpp
r391 r467 395 395 } 396 396 397 SString GenMan::HTMLize(const char *g) { return HTMLize(g, false); }398 399 SString GenMan::HTMLizeShort(const char *g) { return HTMLize(g, true); }400 401 SString GenMan::HTMLize(const char *g, bool shorten)397 string GenMan::HTMLize(const char *g) { return HTMLize(g, false); } 398 399 string GenMan::HTMLizeShort(const char *g) { return HTMLize(g, true); } 400 401 string GenMan::HTMLize(const char *g, bool shorten) 402 402 { 403 403 char buf[50]; … … 407 407 uint32_t *styletab = new uint32_t[len]; 408 408 GetFullStyle(g, styletab); 409 SString html = "\n<div style=\"background:white;padding:0.2em;font-family:arial,helvetica,sans-serif;font-size:90%\">";409 string html = "\n<div style=\"background:white;padding:0.2em;font-family:arial,helvetica,sans-serif;font-size:90%\">"; 410 410 uint32_t prevstyle, prevcolor, style = 0, color = 0; 411 411 for (int i = 0; i<len; i++) … … 448 448 void GenMan::p_htmlize(ExtValue *args, ExtValue *ret) 449 449 { 450 ret->setString(HTMLize(args->getString().c_str()) );450 ret->setString(HTMLize(args->getString().c_str()).c_str()); 451 451 } 452 452 453 453 void GenMan::p_htmlizeshort(ExtValue *args, ExtValue *ret) 454 454 { 455 ret->setString(HTMLizeShort(args->getString().c_str()) );455 ret->setString(HTMLizeShort(args->getString().c_str()).c_str()); 456 456 } 457 457 -
cpp/frams/genetics/genman.h
r286 r467 48 48 uint32_t Style(const char* g, int pos); //returns Style (and validity) of a genotype char. 49 49 void GetFullStyle(const char *g, uint32_t *styletab); //optimized. Fills styletab with styles for all genotype chars. sizeof(*styletab) must be at least strlen(g). 50 SString HTMLize(const char *g); //returns colored genotype in HTML.51 SString HTMLizeShort(const char *g); //returns colored genotype (abbreviated if needed) in HTML.50 string HTMLize(const char *g); //returns colored genotype in HTML. 51 string HTMLizeShort(const char *g); //returns colored genotype (abbreviated if needed) in HTML. 52 52 Geno GetSimplest(char format); ///<returns pointer to the simplest genotype of \e format or empty Geno() 53 53 const char *GetOpName(char format); ///<returns pointer to the active operator set for \e format … … 57 57 void saveLink(const string parent1, const string parent2, const string child, const float chg); 58 58 GenoOperators* getOper_f(char format); 59 SString HTMLize(const char *g, bool shorten);59 string HTMLize(const char *g, bool shorten); 60 60 public: 61 61 vector<GenoLink> GenoLinkList;
Note: See TracChangeset
for help on using the changeset viewer.