Changeset 467


Ignore:
Timestamp:
02/07/16 23:21:55 (9 years ago)
Author:
Maciej Komosinski
Message:

GenMan? interface uses STL std::string instead of SString

Location:
cpp/frams/genetics
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/genman.cpp

    r391 r467  
    395395}
    396396
    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)
     397string GenMan::HTMLize(const char *g) { return HTMLize(g, false); }
     398
     399string GenMan::HTMLizeShort(const char *g) { return HTMLize(g, true); }
     400
     401string GenMan::HTMLize(const char *g, bool shorten)
    402402{
    403403        char buf[50];
     
    407407        uint32_t *styletab = new uint32_t[len];
    408408        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%\">";
    410410        uint32_t prevstyle, prevcolor, style = 0, color = 0;
    411411        for (int i = 0; i<len; i++)
     
    448448void GenMan::p_htmlize(ExtValue *args, ExtValue *ret)
    449449{
    450         ret->setString(HTMLize(args->getString().c_str()));
     450        ret->setString(HTMLize(args->getString().c_str()).c_str());
    451451}
    452452
    453453void GenMan::p_htmlizeshort(ExtValue *args, ExtValue *ret)
    454454{
    455         ret->setString(HTMLizeShort(args->getString().c_str()));
     455        ret->setString(HTMLizeShort(args->getString().c_str()).c_str());
    456456}
    457457
  • cpp/frams/genetics/genman.h

    r286 r467  
    4848        uint32_t Style(const char* g, int pos); //returns Style (and validity) of a genotype char.
    4949        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.
    5252        Geno GetSimplest(char format); ///<returns pointer to the simplest genotype of \e format or empty Geno()
    5353        const char *GetOpName(char format); ///<returns pointer to the active operator set for \e format
     
    5757        void saveLink(const string parent1, const string parent2, const string child, const float chg);
    5858        GenoOperators* getOper_f(char format);
    59         SString HTMLize(const char *g, bool shorten);
     59        string HTMLize(const char *g, bool shorten);
    6060public:
    6161        vector<GenoLink> GenoLinkList;
Note: See TracChangeset for help on using the changeset viewer.